mysql去除重复保留最新一条记录代码
delete from ol_news
where title in ( select title from (
select title from ol_news group by title having count(ID) > 1
) as TAB1 )
and ID not in (
select ID from (
select min(ID) as ID from ol_news group by title having count(ID) > 1
) as TAB2
)
版权与免责声明:
凡注明稿件来源的内容均为转载稿或由网友用户注册发布,本网转载出于传递更多信息的目的;如转载稿涉及版权问题,请作者联系我们,同时对于用户评论等信息,本网并不意味着赞同其观点或证实其内容的真实性;