inserting data from one table to another using sql [message #39463] |
Thu, 18 July 2002 06:31 |
mrweatherbee
Messages: 13 Registered: June 2002
|
Junior Member |
|
|
Hi guys,
I'm having a little trying to get this sql statement right. basically i have four tables and need to fill a blank column in table1 with a value from table4. here's how the tables are set up:
table1(employeeid, division)
table2(employeeid, ssnum)
table3(ssnum, divisioncode)
table4(divisioncode, divisionname)
so table1 has employeeid filled out already for each row and division is blank. basically i need to fill the division column in table1 with the division name in table 4 for each row in table1. for example if the employeeid in the first row in table 1 is 0001, the sql statement needs to find employeeid 0001 in table 2, get his ssnum, go to table 3 and find the division code that matches that ssnumber and then go to table 4 and match that division code to the division name, and then insert that division name into the division column for employee 0001 in table 1 and then do the same thing for every row in table 1. hopefully that all made sense! :) anyways, if anyone could give me some help on how to write this statement it would be GREATLY appreciated! thank you so much
mr.w
|
|
|
|