There are two tables: Apply and Applydetails, and the two tables are associated with Applyno.
Apply
Column Name |
Type |
Applyno |
varchar |
Applydate |
Datetime |
State |
varchar |
Applydetails
Column Name |
Type |
Applyno |
varchar |
Idcard |
varchar |
Name |
varchar |
State |
varchar |
1) Update the state value in the table Applyno as "0001" to "1" in Apply and applydetails;
Mysql:
1 UPDATEapply T1, Applydetail T22 SETT1.state='0', T2.state='0'3 WHERET1.applyno=T2.applyno andT1.applyno='0001' andT2.applyno='0001';
2) Update the state value in the table Idcard as "2120141021003731" to "1" in Apply and applydetails;
Mysql:
1 UPDATE apply T1, Applydetail T2 2 SET t1.state='1', t2.state='1' 3WHERE t1.applyno= and T2.idcard=' 2120141021003731';
Note: the above SQL statements are only carried out in MySQL5.5, and SQL Server and Oracle do not know if they can be executed and are being tested.
SQL multi-table updates update