Sql语句
1.假如a表存在,则
insert into A(a,b,c) (select a,b,c from B)
假如A表不存在,则
select a,b,c into A from B
假如需要跨数据库库
A表存在
insert into A表数据库名.[dbo].A(a,b,c)
(select a,b,c from B表数据库名.[dbo].B)
2.SQL中如何把一个表中的字段值用另外一表中相应字段的值来替换
UPDATE PT_ProductInfo SET PI_PictrueName= BA.BA_Name FROM PT_ProductInfo, BT_BussinessAttachment as BA
WHERE BA.BA_BussinessID = PT_ProductInfo.PI_ID