insert into phone2(ph,attr,type,carrier) select top 1000 ph,attr,type,carrier from phone
将表phone的字段和前1000条数据复制到Phone2表
数据库中的某个表删除重复数据(phone2表不能存在)
select distinct * into phone2 from phone
表phone的数据放到phone2中(phone2表可以存在)
insert into phone2(ph,attr,type,carrier) select distinct
(ph),attr,type,carrier from
phone
删除phone表
truncate table phone
表phone2的数据重新放回到phone表中,保证表的名字相同
insert into phone (ph,attr,type,carrier) select
ph,attr,type,carrier from phone2
SqlServer将表中数据复制到另一张表,布布扣,bubuko.com
时间: 2024-12-25 01:22:32