题是这样的tab1表中有Id和phone两个字段,其中ID是主键,phone字段中有很多重复的记录,写一条sql语句删除重复的记录

 delete from tab1 where id not in
(SELECT max(id) FROM tab1 GROUP BY phone)

测试通过。。。

相关文章: