I have the following query:
SELECT pe.id_person , pa.id_person_patient , *
FROM patient as pa INNER JOIN person as pe on ( pa.id_person_patient = pe.id_person )
WHERE pe.elimination_date is null OR pe.elimination_date = 0
AND pe.name = 'ALEJANDRA'
GROUP by pa.id_person_patient
But the clause
AND pe.name = 'ALEJANDRA'
Returns a result that is not valid. Why do I return a row with the name 'TEST'
, if the clause says that it only looks for a name where it says 'alejandra'
?