Business: update the fields of one table to another table;
I encountered a problem today. I was confused for a long time. In my memory, the first way of writing is correct, but in mysql, it is not right to try for a long time. writing;
The first way to write:
UPDATE t
SET t.spu = b.spu
FROM
table1 t,
table2 b
WHERE
t.vin = b.vin;
After tossing for a long time to find the information, I saw the following writing method, which can be executed normally;
Correct spelling:
UPDATE table1 t, table2 b
SET t.spu = b.spu
WHERE
t.vin = b.vin;