1UPDATE table-name SET column-name = value, column-name = value WHERE condition = value
1-- CANT do multiple sets but can do case
2UPDATE table
3SET ID = CASE WHEN ID = 2555 THEN 111111259
4 WHEN ID = 2724 THEN 111111261
5 WHEN ID = 2021 THEN 111111263
6 WHEN ID = 2017 THEN 111111264
7 END
8WHERE ID IN (2555,2724,2021,2017)
9
1/*You can't update multiple tables in one statement,
2however, you can use a transaction to make sure that
3two UPDATE statements are treated atomically.
4You can also batch them to avoid a round trip.*/
5
6
7BEGIN TRANSACTION;
8
9UPDATE Table1
10 SET Table1.LastName = 'DR. XXXXXX'
11FROM Table1 T1, Table2 T2
12WHERE T1.id = T2.id
13and T1.id = '011008';
14
15UPDATE Table2
16SET Table2.WAprrs = 'start,stop'
17FROM Table1 T1, Table2 T2
18WHERE T1.id = T2.id
19and T1.id = '011008';
20
21COMMIT;
22