Can someone explain me how below query will work.. i have table called employee
id FirstName LastName Email Groupid
1 Paula Brown pb@testdomain.org 12
2 James Smith jim@test.co.uk 12
3 James Connor jc@tes.co.uk 13
select * from employee where groupid=12 AND id NOT IN (1) OR id NOT IN (2)
how does this query works? Am trying to understand how AND clause works with OR. Any help would be appreciated…
ANDhas precedence overOR, so the condition is interpreted asAll three records match this condition:
If you are looking for a different order of evaluation, you can force it using parentheses.