I'm looking to update multiple rows in postgres in one statement. Is there a way to do something like the following?
UPDATE table
SET
column_a = 1 where column_b='123',
column_a = 2 where column_b='345'
Yes, you can:
And working proof: http://sqlfiddle.com/#!2/97c7ea/1 | |||||||||||||||||
|
You can also use
You can add as much column as you want:
| |||||
|