January 2019
Beginner
556 pages
14h 19m
English
The second way of updating rows in the table is to use the FROM clause in a similar manner as in the SELECT statement:
UPDATE car_portal_app.a SET a_int = b_int FROM car_portal_app.b WHERE a.a_text=b.b_text;
Every row from a, when there are rows in b with the same value of the text field, will be updated. The new value for the numeric field is taken from the b table. Technically, it's nothing but an inner join of the two tables. However, the syntax here is different. As the a table is not a part of the FROM clause, using the usual JOIN syntax isn't possible and the tables are joined on the condition in the WHERE clause. If another table were used, it would be possible to join it to the b table using the join ...
Read now
Unlock full access