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

来源:互联网 发布:网络语666是什么意思 编辑:程序博客网 时间:2024/06/08 05:26

问题举例

表A

finterid fbillno frob 1 SOUT0001 1 2 SOUT0002 1 3 SOUT0003 -1 4 SOUT0004 -1

表B

finterid fsourceentryid fsourcebillno fnumber famount 1 01.001 15.00 1 01.002 20.00 2 01.003 30.00 2 01.004 50.00 3 SOUT0001 01.001 =(-1)*famount where finterid=1 and fnumeber=01.001 3 SOUT0001 01.002 =(-1)*famount where finterid=1 and fnumeber=01.001 4 SOUT0002 01.003 =(-1)*famount where finterid=2 and fnumeber=01.001 4 SOUT0002 01.004 =(-1)*famount where finterid=2 and fnumeber=01.001

问题提出

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

问题解答

????????????????????????
阅读全文
0 0
原创粉丝点击