sql server 2005 如何查询并删除同时有2个字段内容重复的数据

日期:2016-02-25 19:16:47 人气:2

sql server 2005 如何查询并删除同时有2个字段内容重复的数据

delete from table t1 where exists( select * from (select 缴费编号,缴费金额,max(缴费时间) as 缴费时间,count(*) as con from table group by 缴费编号,缴费金额 ) t2 where t1.缴费编号=t2.缴费编号 and t1.缴费编号=t2.缴费编号 and t1.缴费时间=t2.缴费时间 and t2.con>1 )
    A+
热门评论