I have a table PEOPLE, and each record in this table is left joined to another table XYZ that may or may not contain several records for each PEOPLE record. Multiple records related to the PEOPLE record may contain none, one or both of two desired codes, say A or B. So if A or B is found in any of the XYZ records, I want only a single instance returned. I have tried several approaches using EXISTS, SELECT 1, etc., but am still getting 2 instances returned for each PERSON record when both A and B are found in their XYZ records.
Any help on this will be greatly appreciated.
Any help on this will be greatly appreciated.