sql导出到excel
1、先查询数据ID,别名 导出到excel
2、增加标准名称,标识错误数据,导入sqlServer
select distinct [StandardName] from [GMSOA].[dbo].[校准$]
distinct 排除相同数据,只显示一次
3、sql将查询到的数据插入另一张表(数据列名)
insert into GMSOA.dbo.SN(SN) select distinct SN from Standard
4、将查询到的数据更新到另一张表"update a set a.name=b.name1 from a,b where a.id=b.id"
Update SN
set SN.CNAS=s.CNAS,SN.PRO=s.PRO
from SN,
(Select SN,CNAS,PRO from SNN)s
where SN.ID=s.ID
and EngineerInfo.Deleted='False'or EngineerInfo.deleted is null