您的位置:首页 > 数据库

SQL更新多行数据为不同的值如何实现?

2017-12-12 16:41 316 查看

问题举例

表A

finteridfbillnofrob
1SOUT00011
2SOUT00021
3SOUT0003-1
4SOUT0004-1
表B

finteridfsourceentryidfsourcebillnofnumberfamount
101.00115.00
101.00220.00
201.00330.00
201.00450.00
3SOUT000101.001=(-1)*famount where finterid=1 and fnumeber=01.001
3SOUT000101.002=(-1)*famount where finterid=1 and fnumeber=01.001
4SOUT000201.003=(-1)*famount where finterid=2 and fnumeber=01.001
4SOUT000201.004=(-1)*famount where finterid=2 and fnumeber=01.001

问题提出

如何用一条语句更新finterid in(3,4)的famount的值。

问题解答

????????????????????????
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  数据 sql