Update multiple columns based on if one column has a certain value
I have a question regarding a PSQL database.
I am a little bit stuck.
The logic is:
IF table1.column_1 IS var
THEN table1.column_2 = foo
AND table1.column_3 = bar
Essentially, if one column contains a specific value, then how can I
update other columns?
I am new with PSQL, so please be gentle! I have looked at Case statements,
but it seems you can't have an Update inside a case. If an if/else is what
I need, could someone provide a simple example?
Thank you for any help.
No comments:
Post a Comment