I am querying for a unique key in Table A called column X. Table Column X joins to Table B which contains 3 records. If column Z of Table B contains the word "BAD" for all three records, I want to select the unique key from Table A. However, if just one of those fields contains the word "GOOD", I do NOT want to select the unique key from Table A.
How do I write this query? Since the logic looks at a per record basis, I cannot just say "give me column X where column Z != "Good"