您的位置:首页 > 数据库

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: