I have a table in postgres that I need to update:
\d+ teachers;
Table "public.teachers"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
------------+-----------------------+-----------+----------+--------------------------------------+----------+--------------+-------------
id | bigint | | not null | nextval('teachers_id_seq'::regclass) | plain | |
first_name | character varying(25) | | | | extended | |
last_name | character varying(50) | | | | extended | |
school | character varying(50) | | | | extended | |
hire_date | date | | | | plain | |
salary | numeric | | | | main | |
Access method: heap
I have 2 update statements that I want to make in postgres, but in the future there will be a lot more:
UPDATE teachers SET id = 11 WHERE id = 23;
UPDATE teachers SET id = 12 WHERE id = 24;
How do I combine these update statements into one statement?