I want to check the logic on this query. If I write:
SELECT user.id FROM users WHERE user.firstname = ‘John’ AND user.lastname = ‘Doe’ OR user.lastname = ‘Smith’
Does the AND/OR relationship work like IF/ELSE? Can I assume that my OR condition will be linked to the AND that directly precedes it? In this case (Doe or Smith).
I want to make sure that the logic is grouping like this:
[AND x] && [ y OR z ]
not
[AND x AND y] || z