表中有一个字段用来批量导入的ID,这个ID可以确定这一批次的数据,有一个自动编号的ID
删除重复数据,同时要保留重复数据的一条记录下来,如下:
delete from SMS_SendInfoTemp where Mobile in (select Mobile from SMS_SendInfoTemp where HisID='484' group by Mobile having count(Mobile) > 1) and ID not in (select min(ID) from SMS_SendInfoTemp where HisID='484' group by Mobile having count(Mobile)>1)