UPDATE dbo.table1
SET B.value1= B.value1-A.value2
FROM dbo.table1 B,dbo.table2 A
where B.value3=A.value3
我想加一个判断条件当 B.value1>A.value2的时候才执行以上条件,怎么加?
UPDATE dbo.table1
SET B.value1= B.value1-A.value2
FROM dbo.table1 B,dbo.table2 A
where B.value3=A.value3
我想加一个判断条件当 B.value1>A.value2的时候才执行以上条件,怎么加?
UPDATE dbo.table1 SET B.value1= B.value1-A.value2 FROM dbo.table1 B,dbo.table2 A
where B.value3=A.value3 and B.valuue1 > A.value2