建一个临时表 按照 select t2,t3,t4 from 表 group by t2,t3,t4 having count(*)〉=2 找到所有你所谓的脏数据。 插入临时表 用delete 表 group by t2,t3,t4 having count(*)〉=2 删除这些记录。 然后再把临时表里的数据插回来
试试这个delete 表 where t1 not in ( select min(t1) from 表 group by t2, t3, t4 )
delete from Table where T2=T3 and T3=T4
delete from Table where T2=T3 and T3=T4 --------------------------------------- 这可是最简单的删除呀!!LZ,还有什么不明白的?
group by t2,t3,t4
having count(*)>1
from T
where T2=T3 and T3=T4
按照
select t2,t3,t4 from 表
group by t2,t3,t4
having count(*)〉=2
找到所有你所谓的脏数据。
插入临时表
用delete 表
group by t2,t3,t4
having count(*)〉=2
删除这些记录。
然后再把临时表里的数据插回来
---------------------------------------
这可是最简单的删除呀!!LZ,还有什么不明白的?
1 2 2 2
2 3 4 5
3 3 4 5
t1=1的不是脏数据。
t1=2和t1=3的才是脏数据。楼主是这意思把?
这是正解。