mysql除重复记录实用代码,只保留一条

靖西网牛牛动态域名 2015-08-21
create table tmp001 as select min(jid) as col1 from xiweb_xxx group by tname;
delete from xiweb_xxx where jid not in (select col1 from tmp001);
drop table tmp001;

min()为保留最小jid的记录
浏览828865 / 回复0
举报内容
返回 [发帖] 发回复:评论……

+
提交评论