I have a table like this one, which has two rows:
nombre_per | apellido_per | permisos_busqueda_per
-------------+----------------+----------------------
Mattew | Janeey | SI
Janny | Pineda | NO
My query is as follows
SELECT nombre_per, apellido_per, permisos_busqueda_per
FROM la_tabla
WHERE nombre_per LIKE '%a%' OR apellido_per LIKE '%a%' AND permisos_busqueda_per="SI"
If I'm only looking for users who have permission to be searched ( permisos_busqueda_per
), why do I get the two rows if Janny does not have permission to be found?