1.
delete table1
where col1 in (select col1 from table2)
2.
table1 为你导入数据的表
table2 是你insert into from 后面的表,即重复数据的来源
col1 是能唯一标识你误操作的那些数据的一列
3。然后在insert 一遍就行了。
Insert into table1
select * from table2
delete table1
where col1 in (select col1 from table2)
2.
table1 为你导入数据的表
table2 是你insert into from 后面的表,即重复数据的来源
col1 是能唯一标识你误操作的那些数据的一列
3。然后在insert 一遍就行了。
Insert into table1
select * from table2
insert into table1
(column1,column2)
select column1,column2 from table1
from table
tmptable就是你要的表,
from table1delete A from #temp A,#temp B
where A.id=b.id and a.id>b.id
其中id是table的主鍵要唯一
delete 你的表
insert 你的表
select * from #t
drop table #t
insert again
delete a from 表 a
where exists(select * from 表 where a.id<id and a.usermobile=usermobile)
alter table 表 drop column id兄弟用用我的,我刚刚从别人那里修改来的,经过测试的!
drop table table1
select * into table1 from #tmp
这样可以吗
(Select ID From t_Table a where
(Select Count(*) From t_Table a where a.ID = ID ) > 1 )
这样可以删除重复记录。