There are two ways to use it:
1. Single Statement method:
1) Delete b from Sys_test B, (select *,max (UUID) from Sys_test Group BY ' name ' have count (' name ') > 1) as D where B.uu Id>d.uuid and b.name = D.name
Delete b from Sys_test B is a set alias, the DELETE statement is generally directly connected to the from, when the need to set the from table alias is, the alias needs to be placed before the from, indicating that the deletion is the content of the alias is deleted.
From the different tables used, split, can have sub-query out of the table, followed by where can.
2) Delete form user where ID not in (the Select ID from (select Max (ID) as ID, name, social Security number from the user group by name, Social Security number) as T);
The method is slightly less efficient
2. Temporary table method
1), find all duplicate data, and copy the duplicate data to a temporary table
SELECT * into #temp1 from the user group by ' name ' have count (' name ') > 1
2), delete all duplicate data from the original table
Delete from the user where name in (the Select ' name ' from the user group by ' name ' has count (' name ') > 1);
3), insert the data from the staging table back into the user table
INSERT INTO user select * from #temp1;
4), delete temporary table
Drop #temp1;
MySQL Go heavy