Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SQL: выбор не уникальных (повторяющихся) значений из таблицы
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
You can’t perform that action at this time.