I'm trying to compare two tables and work on a result of this operation.
SELECT * FROM table1
WHERE table1.czlowiek_id NOT IN (
SELECT table2.czlowiek_id
FROM table2
WHERE table1.czlowiek_id=table2.czlowiek_id
)
OR table1.czlowiek_id IN (
SELECT table2.czlowiek_id
FROM table2
WHERE table1.czlowiek_id=table2.czlowiek_id
AND table2.szkolenie_id IN ('$selected_one')
AND table1.instruktor IN ('$selected_two')
)
Is there some option to work on a result from this query adding another WHERE statement?