一条语句删除重复行
一条语句删除重复行
--可以检测到null列重复
delete from [JCXS0201] where
USER_ID in(select User_ID u from [JCXS0201] group by User_ID having COUNT(id) >1 )
and
id not in (select MIN(id) from [JCXS0201] where USER_ID in( select User_ID from [JCXS0201] group by User_ID having COUNT(id) >1 ) )
www.zzzyk.com
--不可以检测到null列重复
delete from [JCXS0201] where
USER_ID in( select User_ID u from [JCXS0201] group by User_ID having COUNT(id) >1 )
and
id not in (select MIN(id) from [JCXS0201] group by User_ID having COUNT(id) >1 )