Created
August 8, 2018 14:49
-
-
Save AlexMcowkin/ab112ddac443e06ddaac9b053f38a9aa to your computer and use it in GitHub Desktop.
SQL: выбор не уникальных (повторяющихся) значений из таблицы
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `post` ( | |
`id` int(11) NOT NULL, | |
`name` varchar(100) NOT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
//---------------------------------------- | |
SELECT id, name FROM post WHERE id IN (SELECT id FROM post GROUP BY id having count(id) > 1) ORDER BY id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment