Skip to content

Instantly share code, notes, and snippets.

@Buzovskiy
Created February 21, 2020 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Buzovskiy/71b74922a96dfd0941c1adc24f479df9 to your computer and use it in GitHub Desktop.
Save Buzovskiy/71b74922a96dfd0941c1adc24f479df9 to your computer and use it in GitHub Desktop.
Для удаления дубликатов подойдет такой прием:
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