Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

I need help selecting records in table a that are not in table b

$
0
0
I need to select the records that are in table_a but not in table_b, the thing is that I also need to select the records in table_a that dont have birthdate and the records on table_b that doesnt have answers, something like this:

SELECT pacient.* FROM pacient
LEFT JOIN test
ON pacient.idpacient = test.idpacient
WHERE test.idpacient IS NULL
OR pacient.date_birth IS NULL
OR test.answer = 0

To clear it all out I need the records of the persons that dont have birthdate, or are not in table_b or that their answer is 0

Viewing all articles
Browse latest Browse all 13329

Trending Articles