UPDATE statement: the statement that updates the fields in one table to the fields in another table adds a field to a table in one table in the modification of the result query system, now we need to copy the corresponding ID of another table. because such SQL operations are not often used, we even think of writing a loop for processing. However, I thought that SQL should be able to implement such a function. I checked the manual and it was really simple. There was a syntax for updating... from. Example: Table Aid subject_id1 null2 null3 null4 null5 null6 null table Bsb_id st_id5 12 25 35 42 52 6SQL statement: 1UPDATEASETA. subject_id = B. sb_idFROMBWHEREB.student_id =. id update: The preceding statement is only applicable to mssql server. The following statement should be used in mysql: 1 UPDATEA, BSETA. subject_id = B. sb_idWHEREB.student_id =. id Example 2: MYSQL is the update table2 B, (select B. area_id as arid, sum (. user_amount) as bcountfrom table1 a, table2 bwhere. user_area = B. area_idgroup by ari D) cset B. count = c. bcountwhere B. area_id = c. arid; a dedicated MYSQL instance is installed for testing and passes the test.