Implementation Code of SQL update multi-table join update, sqlupdate
Update multiple tables, especially the data in Table A and Table B of table A. The following is an example.
There are tables A and B with the following records:
Table
C1 c2
--------------
1 a1
2 a2
3 a3
8 a8
Table B
C1 c3
--------------
1 b1
2 b1
3 b3
10 b10
A. c1 is equal to B. c1. Use an SQL statement to update the value of A. c2 to B. c3.
Bytes ---------------------------------------------------------------------------------------
Statement 1
UPDATE A SET A.c2 =B.c3from A ,Bwhere A.c1=B.c1
Statement 2
UPDATE ASET A.c2 =B.c3from A inner join B on A.c1=B.c1
Note:
The update clause cannot be followed by multiple tables, but is followed by the from clause.
Summary
The above is the implementation code of SQL update multi-Table Association update introduced by xiaobian. I hope it will be helpful to you. If you have any questions, please leave a message for me, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!