merge into 表2 as a
using 表1 as b
on a.data1=b.data1
when matched and a.status=1 then update set a.data2=b.data2
when not metched and a.status=1 then insert(id,data1,data2) values(id,data1,data2)
using 表1 as b
on a.data1=b.data1
when matched and a.status=1 then update set a.data2=b.data2
when not metched and a.status=1 then insert(id,data1,data2) values(id,data1,data2)
解决方案 »
- 为什么SQL SERVER 2008 数据库表列属性的说明为什么超过十个字后就会自动添加一个换行符?
- 在问下作业调度,步骤和效率方面的问题?
- 在sqlserver中求一sql语句~
- 请问SQL语句中应该过滤或替换掉哪些字符??
- 求存储过程加密方式或代码(存储过程),注:不要with encryption
- 请教VS2010数据库项目的问题,谢谢~
- 在线求解,急急急急急急急急急急急急!
- 关于数据库没法连接?(在线等)
- SQL卸载后,重新安装失败(急,若嫌分不够尽管说)
- 如何用一条update语句将某个数据表中一条记录的全部字段都赋值成外部值,这些值来自xml解析包
- sql字符串区分
- 求大神帮忙 谢谢 急!
using 表1 as b
on a.data1=b.data1
when matched and b.status=1 then update set a.data2=b.data2
when not metched and b.status=1 then insert(id,data1,data2) values(b.id,b.data1,b.data2)