I'm importing data from one database to another. The previous database used id numbers to identify relations between tables, and I'm trying to get rid of them. I've imported all data, and the situation now is as follows:
Table 1: COMPANY
com_nickname
com_idnumber
Table 2: NICKNAME
nic_nickname
nic_idnumber
What I am trying to do is change all the records in com_nickname to the names listed in table NICKNAME, according to the correct ID number. (At this moment, com_nickname is null in all records, all the other fields have been filled.)
I've tried doing this with an Update query, but found I couldn't use data from both tables in one query that way. Then I tried a nested Update/Select query, but that merely resulted in selecting all records from Nickname, after which SQL was clueless how to put all that information in the appropriate Company records.
Can anybody help me figure out the correct query for this problem? I'd hate to have to update all 3000 records manually...
Thanks in advance!
Table 1: COMPANY
com_nickname
com_idnumber
Table 2: NICKNAME
nic_nickname
nic_idnumber
What I am trying to do is change all the records in com_nickname to the names listed in table NICKNAME, according to the correct ID number. (At this moment, com_nickname is null in all records, all the other fields have been filled.)
I've tried doing this with an Update query, but found I couldn't use data from both tables in one query that way. Then I tried a nested Update/Select query, but that merely resulted in selecting all records from Nickname, after which SQL was clueless how to put all that information in the appropriate Company records.
Can anybody help me figure out the correct query for this problem? I'd hate to have to update all 3000 records manually...
Thanks in advance!