What you want to do is make an additional join to the actual_address table as follows:
SELECT GUEST_ADDRESS.ADDRESS_CODE,(GUEST_FNAME+' '+GUEST_LNAME) AS GUEST_NAMES FROM GUEST JOIN GUEST_ADDRESS ON GUEST.ADDRESS_NUM = GUEST_ADDRESS.ADDRESS_NUM JOIN ACTUAL_ADDRESS ON GUEST_ADDRESS.ADDRESS_CODE = ACTUAL_ADDRESS.ADDRESS_CODE
Remember, if I ask, why do you have this link table? Can guests have multiple addresses? If so, I would change the connection from GUEST_ADDRESS to GUEST based on GUEST_ID , not ADDRESS_NUM , since using ADDRESS_NUM makes the relationship between the two tables one-to-one, and not one-to-many
It is also worth noting that the above request will not return a guest entry if there is no address in the ACTUAL_ADDRESS table or the link in the GUEST_ADDRESS table due to JOIN . If you want it to return guest details regardless of address, you can simply change the JOIN to LEFT JOIN
source share