I've got the next SQL query:
SELECT FIRST_NAME, LAST_NAME
FROM MYTABLE
WHERE STATUS = 1 AND VARIABLE IN ( 'PR', 'AR' ) AND SPECIAL = 1;
SPECIAL is an aditional condition which is added if I previously selected 'PR' (checkbox) in my form. The thing is, with this query, I'm no longer getting rows where VARIABLE is 'AR'.
Now, the idea is that this query should return any rows when VARIABLE is 'PR' or 'AR', but if it is 'PR', from this 'PR'-only group, it should return only the SPECIAL ones. I mean, it should still display rows with VARIABLE = 'AR', but if SPECIAL = 1, then the ones that are 'PR', should be only those where SPECIAL = 1.
I know the idea should be very simple, but I totally panicked when they gave me this assignment, because I keep trying.