Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- update table_A
- set column_A = case when column_A>table_B.balance then value else column_A end,
- column_B = case when not (column_A>table_B.balance)
- and (column_B>table_B.balance) then value else column_B end,
- column_C = case when not (column_A>table_B.balance)
- and not (column_A>table_B.balance)
- and (column_C>table_B.balance) then value else column_C end
- from table_B
- on table_A.Id=table_B.id
Add Comment
Please, Sign In to add comment