现有一张student表:
name相同的记录只保留一条:
DELETE t1 from student as t1 left join
(select name, min(id) as id from student group by name) as t2 on t1.id = t2.id where t2.id is null
现有一张student表:
name相同的记录只保留一条:
DELETE t1 from student as t1 left join
(select name, min(id) as id from student group by name) as t2 on t1.id = t2.id where t2.id is null