Thanks David,
The situation I have is, we have a master codes table (MasterCodes) made of code_type, code_id, code_description so we do not have a table for each code type, i.e type='01' Race code, type='02' Marital status,
for a patient table (Patients) with columns, last,first,race_code,maritalStatuscode
SELECT A.last,A.first,C.code_description
FROM Patients A LEFT JOIN MasterCodes C ON (A.race_code=C.code_id AND C.code_type='01')
WHERE ....
this would be a left join returning all records from patient tables meeting the where criteria and if a code is not found MasterCode I would get null for code description
But,
SELECT A.last,A.first,C.code_description
FROM Patients A LEFT JOIN MasterCodes C ON (A.race_code=C.code_id)
WHERE C.code_type='01'
would turn the join into inner join and only get the records that have a mastercode type ='01'
so if code_type='01' is missed by any chance I would not get a list of patients,
This is legacy app that patients can define their race code, we need the customer to see the patient record even if the race code is not defined
I hope this make sense why I need the col='some value in the join clause
Thank you