sql删除表中重复记录只保留一条记录
最终代码
update T_Fee set gzl_dfg_op = 'delete' where MetReadRecordID in ( select MetReadRecordID from T_Fee where FeeItemID =2 and State =1 and MetReadRecordID is not null group by MetReadRecordID having COUNT(MetReadRecordID)>1 ) and ID not in ( select min(ID) from T_Fee where FeeItemID =2 and State =1 and MetReadRecordID is not null group by MetReadRecordID having COUNT(MetReadRecordID)>1 )
更多精彩内容请看:http://www.cnblogs.com/2star>