469,623 Members | 1,505 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Multiple update in single db2 sql query


I want to update column A based on the column B.

the syntax is like that : update table (tablename)
set column A=12 when column B=10
set column A=15 when column B=14
set column A=122 when column B=133
i dont know the correct syntax.plz do reply if anyone knows.
Dec 5 '06 #1
1 5570
look at the CASE function.... you may have to update all 3 columns and set them back to there current value if they dont pass the case expression
Dec 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by dskillingstad | last post: by
8 posts views Thread by Jason L James | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.