Recordsetclown
Technical User
I am stumped as to how to make this work. I have the following elements:
UPDATE default_en_listingsdb as r1
INNER
JOIN default_en_listingsdbelements as r2
ON r2.listingsdb_id = r1.listingsdb_id
AND r2.listingsdbelements_field_name = 'MLSID'
AND r2.listingsdbelements_field_value = 'M223'
r1 and r2 are related on listingsdb_id, but the value I need to put into r1 comes from a table with no direct relationship to these. I need to match names that are also stored in r2, with user names in default_en_userdb, call it r3, to find the userid to put into r1.
r2.listingsdbelements_field_name = 'agentfirstname'
AND r2.listingsdbelements_field_value = r3.userdb_user_first_name
AND r2.listingsdbelements_field_name = 'listingagentlastname'
AND r2.listingsdbelements_field_value = r3.userdb_user_last_name
SET r1.userdb_id = r3.userdb_id
Can anyone tell me how to put this together?
UPDATE default_en_listingsdb as r1
INNER
JOIN default_en_listingsdbelements as r2
ON r2.listingsdb_id = r1.listingsdb_id
AND r2.listingsdbelements_field_name = 'MLSID'
AND r2.listingsdbelements_field_value = 'M223'
r1 and r2 are related on listingsdb_id, but the value I need to put into r1 comes from a table with no direct relationship to these. I need to match names that are also stored in r2, with user names in default_en_userdb, call it r3, to find the userid to put into r1.
r2.listingsdbelements_field_name = 'agentfirstname'
AND r2.listingsdbelements_field_value = r3.userdb_user_first_name
AND r2.listingsdbelements_field_name = 'listingagentlastname'
AND r2.listingsdbelements_field_value = r3.userdb_user_last_name
SET r1.userdb_id = r3.userdb_id
Can anyone tell me how to put this together?