delete from tb_news where id not in ( select max(id) From tb_news Group By title )
刚开始用这条语句删除一直不成功
然后百度了一下,说是要建立一张临时表
于是进行了以下操作
先建立一个临时表
CREATE TEMPORARY TABLE tmp_news ( `id` BIGINT(20) )
然后执行以下语句
delete from tb_news where id not in (SELECT * from ( select max(id) From tb_news Group By title ) t)
删除成功!