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
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