Created
February 21, 2020 13:41
-
-
Save Buzovskiy/71b74922a96dfd0941c1adc24f479df9 to your computer and use it in GitHub Desktop.
Для удаления дубликатов подойдет такой прием:
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 TEMPORARY TABLE `t_temp` | |
as ( | |
SELECT min(id) as id | |
FROM `table` | |
GROUP BY name, surname | |
); | |
DELETE from `table` | |
WHERE `table`.id not in ( | |
SELECT id FROM t_temp | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment