Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
id | name 1 | Ivan 2 | Ivan 3 | Egor 4 | Nikita 5 | Nikita 6 | Anton
id | name 3 | Egor 6 | Anton
DELETE FROM tablename WHERE name IN ( SELECT name FROM tablename GROUP BY NAME HAVING count(*) > 1 )
SELECT * FROM docs WHERE name IN ( SELECT name FROM docs GROUP BY name HAVING count(*) < 2 )
DELETE `t1`.* FROM `table` AS `t1` JOIN `table` AS `t2` ON `t2`.`name` = `t1`.`name`