I'm having a problem writing the code for this.
what I'm trying to do is update the tbl Blr_temp_contact by setting the Ref_ID equal to the Blr_temp_contact.id where the first bus_name is listed. Import_ID is equal to the ID in the tbl Blr_import. Let me give you an example of what I want the data to look like. Pay attention to the Ref_ID of what I want it to do.
For Ex. Ref_id - 4, 2
id import_id ref_id Bus_name
-----------------------------------------------
1 32151 1 KENTON CO FISCAL COURT KY
2 32152 2 COMMONWEALTH OF KY
3 32153 3 BENHAM SCHOOL HOUSE
4 32154 4 LAUREL HEIGHTS HOME
5 32155 4 LAUREL HEIGHTS HOME
6 32158 2 COMMONWEALTH OF KY
7 32159 7 THE SALVATION ARMY
8 32160 8 MASONIC HOME OF KY
This is what I have so far:
Update Blr_temp_contact
set Ref_ID = ID
where Import_ID IN
(Select id
from Blr_import
where owner_name = Blr_temp_contact.bus_name
)
Am I even close to the data I'm trying to view?
what I'm trying to do is update the tbl Blr_temp_contact by setting the Ref_ID equal to the Blr_temp_contact.id where the first bus_name is listed. Import_ID is equal to the ID in the tbl Blr_import. Let me give you an example of what I want the data to look like. Pay attention to the Ref_ID of what I want it to do.
For Ex. Ref_id - 4, 2
id import_id ref_id Bus_name
-----------------------------------------------
1 32151 1 KENTON CO FISCAL COURT KY
2 32152 2 COMMONWEALTH OF KY
3 32153 3 BENHAM SCHOOL HOUSE
4 32154 4 LAUREL HEIGHTS HOME
5 32155 4 LAUREL HEIGHTS HOME
6 32158 2 COMMONWEALTH OF KY
7 32159 7 THE SALVATION ARMY
8 32160 8 MASONIC HOME OF KY
This is what I have so far:
Update Blr_temp_contact
set Ref_ID = ID
where Import_ID IN
(Select id
from Blr_import
where owner_name = Blr_temp_contact.bus_name
)
Am I even close to the data I'm trying to view?