Home > database >  How to solve the following two steps to a word - to extract some data into a temporary table, after
How to solve the following two steps to a word - to extract some data into a temporary table, after

Time:01-17

There is now a table is a collection of data, now create a temporary table, part of the collection of data extraction to the temporary table, such as 42 class, the students of class at this time in one sentence can take 42 records are copied to the temporary table, then in the temporary table to modify a field, such as students' gender, after the modification, the synchronization of temporary table to table,
Can with the least amount of code to achieve the synchronization request above

CodePudding user response:

Copy some data, for example, can use the
Insert into t1 select * from t2 where ID=42, so if changed a field of t2, t1 again this field also changed, how to change? There is a column called COL in T2, for example, some lines of COL, this value has changed, so the work done, put all the records of T2 resynchronization back to T1

CodePudding user response:

The update t_6_20053Instr set status=(select the status from t_tmp where t_6_20053Instr. InstrID=t_tmp. InstrID)
Know the
  • Related