select identity(int,1,1) as id,* into #t from ttdelete from tt where exists(select * from tt a where a.id>tt.id and a.a=tt.a and a.b=tt.b)--ordelete from tt where exists(select * from tt a where a.id<tt.id and a.a=tt.a and a.b=tt.b)
调试欢乐多
(select a,b,min(c)as c from tt group by a,b having count(1)>1)
1 select * into ytt from tt 用distinct(a,b), 然后
2 drop tt ,然后在
3 select * into tt from ytt 应该怎么写那?
delete from tb
insert into tb select * from tab
drop table tab