Due to the need of work, today we have encountered a problem: teachers in the educational administration system use the original employee number. Due to new needs, teachers now have a new employee number, now let's do one thing: Make an excel table that lists the name of the teacher, the new employee number, and the old employee number ......
If it is handled manually, the workload of many teachers is too large, so the database is used for processing, because these teachers have a unique and unique name.
Take the following two methods:
1) directly query information that lists the XM, XGH, and JGH fields (XM: name, XGH: New Employee ID, JGH: old employee ID)
New1 table XM and XGH fields, new2 table XM and JGH Fields
SQL: select n1.xm, n1.xgh, n2.jgh from new1 n1, new2 n2 WHERE n1.xm = n2.xm
The result is as follows: copy and paste it to excel to solve this problem.
2) I will insert XM, XGH, and JGH into a new table new, and then export the excel file.
SQL: insert into new (xm, xgh, jgh) select n1.xm, n1.xgh, n2.jgh from new1 n1, new2 n2 WHERE n1.xm = n2.xm
Just Insert the new table, and export the excel file.