MySQL Forums
Forum List  »  PHP

Re: Problem with SQL query :(
Posted by: Rick James
Date: January 19, 2014 12:33PM

First, let's get on the same page for punctuation terminology:
[] - brackets (or "square brackets")
{} - braces (or "curly brackets")
<> - angle brackets
() - parentheses -- but not "brackets"

x AND y OR z is the same as (x AND y) OR z
x OR y AND z is the same as x OR (y AND z)
That is, without parentheses, AND has precedence over OR. If in doubt, add parens.

Your second example probably needed more parens.

Options: ReplyQuote


Subject
Written By
Posted
January 18, 2014 10:39PM
January 19, 2014 12:30PM
January 19, 2014 12:41PM
January 20, 2014 03:24PM
January 21, 2014 06:22PM
January 22, 2014 04:19PM
January 23, 2014 12:15AM
January 23, 2014 10:23AM
Re: Problem with SQL query :(
January 19, 2014 12:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.