db2,sqlserver的更新sql
2007-12-13 11:03
232 查看
/*更新数据的SQL语句写法
1、DB2
update em.t_comm_customer a
set a.custmgr=(select b.custmgr from sq.T_COMM_CUSTOMER20051231 b where a.customercode=b.customercode)
where a.customercode in (select customercode from sq.T_COMM_CUSTOMER20051231)
2、SQL SERVER
update a set a.custmgr=b.custmgr
from em.t_comm_customer a,sq.T_COMM_CUSTOMER20051231 b where a.customercode=b.customercode
/*更新字段内容*/
字符型字段: 在原有字段的基础上,加上'a',在加上字段 BATCHDESC 的内容
db2:update SQ.T_COMM_CUSTOMER_20060318 set VISITSALESMANDESC= VISITSALESMANDESC||'a'||BATCHDESC;
sql server:update dbo.suyu_khdm set khdzdh=khdzdh+'11';
数值型字段:增加1000
db2:update SQ.T_COMM_CUSTOMER_20060318 set VISITSALESMANID=VISITSALESMANID+1000;
sql server:update dbo.sfgs20051012 set xl=xl+1;
1、DB2
update em.t_comm_customer a
set a.custmgr=(select b.custmgr from sq.T_COMM_CUSTOMER20051231 b where a.customercode=b.customercode)
where a.customercode in (select customercode from sq.T_COMM_CUSTOMER20051231)
2、SQL SERVER
update a set a.custmgr=b.custmgr
from em.t_comm_customer a,sq.T_COMM_CUSTOMER20051231 b where a.customercode=b.customercode
/*更新字段内容*/
字符型字段: 在原有字段的基础上,加上'a',在加上字段 BATCHDESC 的内容
db2:update SQ.T_COMM_CUSTOMER_20060318 set VISITSALESMANDESC= VISITSALESMANDESC||'a'||BATCHDESC;
sql server:update dbo.suyu_khdm set khdzdh=khdzdh+'11';
数值型字段:增加1000
db2:update SQ.T_COMM_CUSTOMER_20060318 set VISITSALESMANID=VISITSALESMANID+1000;
sql server:update dbo.sfgs20051012 set xl=xl+1;
相关文章推荐
- SQL 已更新或删除的行值要么不能使该行成为唯一行(sqlserver中有多行所有的列重复的数据,无法更新或删除问题)
- IBM DB2 AS400 sql语句(供个人参考,持续更新)
- Oracle、DB2、SQLSERVER、Mysql、Access分页SQL语句梳理
- Oracle、DB2、SQLSERVER、MySQL、Access分页SQL语句
- ORACLE,SQLSERVER,DB2 删除重复数据SQL
- DB2 多表更新sql
- DB2常用SQL的写法(持续更新中...)
- 1_SQL中符号+;连接符(SQLserver,DB2,oracle,PostreSQL,mySQL))
- 【推荐】sqlserver里有没有定时执行sql语句更新数据库的功能?
- Oracle、DB2、SQLSERVER、Mysql、Access分页SQL语句梳理
- DB2 更新记录update时碰到sqlcode = 911锁表的问题
- db2 常用sql(后续不断更新......)
- 关于SQLSERVER中更新Text类型SQL语句解析
- 数据库分页sql语句(mysql,oracle,sqlserver,DB2)
- 几种常用数据库(SQLServer Oracle db2 mysql等)分页SQL的写法总结
- Oracle、DB2、SQLSERVER、Mysql、Access分页SQL语句
- SQL 已更新或删除的行值要么不能使该行成为唯一行(sqlserver中有多行所有的列重复的数据,无法更新或删除问题)
- oracle,mysql,sqlserver,db2取前十条记录sql语句
- SqlServer学习-常用的sql语句-持续更新中
- SQL 已更新或删除的行值要么不能使该行成为唯一行(sqlserver中有多行所有的列重复的数据,无法更新或删除问题)