update table set d1=d1+(select d1 from table where id='0002'),
d2=d2+(select d2 from table where id='0002'),
d3=d3+(select d3 from table where id='0002'),
d4=d4+(select d4 from table where id='0002'),
d5=d5+(select d5 from table where id='0002')
where id='0001'
d2=d2+(select d2 from table where id='0002'),
d3=d3+(select d3 from table where id='0002'),
d4=d4+(select d4 from table where id='0002'),
d5=d5+(select d5 from table where id='0002')
where id='0001'
解决方案 »
- 如何实线数据库表间数据的复制操作?
- 感谢<DataLife(自由风)>,顺便再问一个小问题
- sql语句优化之索引...一实例求解.100即然.即给分.
- 国内某知名互联网企业的一道压轴笔试题
- 如何在视图的字段运算中将字符型NULL视为'',将数字型NULL视为0 ?
- 为什么我看不到链接服务器里的数据?
- 跪求:字段由float(小数点后6位)型修改为money型(小数点后4位)导致数据丢失,如何恢复?
- 怎么换行?
- 说类型不匹配!这是一个日期列的查询语句:"string("+column+",'yyyy.mm.dd')" + compare + "'" + value + "'" +' '
- 有一张表,我想得到下面的结果,请高手帮忙。
- ◇◆◇ 毕业设计:Elite Listen & Response 英语听力训练软件 (enmity) IX ◇◆◇
- 高手请进:关于SQL SERVER7.0中MASTER数据库的恢复!!!!!!!!!!!!!
insert into test(id,d1,d2,d3,d4,d5) values('001',2,3,3,6,7)
insert into test(id,d1,d2,d3,d4,d5) values('002',6,9,5,2,6)
set order to id
go top
seek '002'
scatter memvar
go top
seek '001'
replace d1 with d1+m.d1,d2 with d2+m.d2,d3 with d3+m.d3,d4 with d4+m.d4,d5 with d5+m.d5