我的
sql语句是:delete from ec_core_userthread as m,(select ID from ec_core_userthread group by user_code having count(*)>1) as n where m.user_code = n.user_code and m.id > n.id
但是执行是会说语法错误,求高手帮忙看看!需求是:我的ec_core_userthread表中存在user_code重复的数据,我想把重复的数据去除了。。
sql语句是:delete from ec_core_userthread as m,(select ID from ec_core_userthread group by user_code having count(*)>1) as n where m.user_code = n.user_code and m.id > n.id
但是执行是会说语法错误,求高手帮忙看看!需求是:我的ec_core_userthread表中存在user_code重复的数据,我想把重复的数据去除了。。
delete m from e
delete from tb_contact where pkid not in (select id from aaaa);
drop table aaaa;
delete from tb_contact where pkid not in (select id from aaaa);
drop table aaaa;
你的这个句子执行报错呀!我使用这个句子,他将没有重复的给删除了!这个应该怎么改呀?
delete m from ec_core_userthread as m left join (select id,user_code,count(*) c from ec_core_userthread group by user_code having c >1) as n on m.user_code = n.user_code where n.user_code is null;
求教!