Operator Precedence Name Description Introduced RLIKE Whether string matches regular expression SOUNDS LIKE Compare sounds XOR Logical XOR | Bitwise OR ~ Bitwise inversion 12.4.1 Operator Precedence Operator precedences are shown in the following list, from highest precedence to the lowest. Operators that are shown together on a line have the same precedence. INTERVAL BINARY, COLLATE ! - (unary minus), ~ (unary bit inversion) ^ *, /, DIV, %, MOD -, + <<, >> & | = (comparison), <=>, >=, >, <=, <, <>, !=, IS, LIKE, REGEXP, IN, MEMBER OF BETWEEN, CASE, WHEN, THEN, ELSE NOT AND, && XOR OR, || = (assignment), := mysql>  SELECT 1+2*3; -> 7 mysql>  SELECT (1+2)*3; -> 9 2124 The precedence of operators determines the order of evaluation of terms in an expression. To override this order and group terms explicitly, use parentheses. For example: See Section 5.1.11, “Server SQL Modes” . •By default,  !  has a higher precedence than  NOT . With  HIGH_NOT_PRECEDENCE  enabled,  !  and  NOT have the same precedence. •By default,  ||  is a logical  OR  operator. With  PIPES_AS_CONCAT  enabled,  ||  is string concatenation, with a precedence between  ^  and the unary operators. The precedence and meaning of some operators depends on the SQL mode: For operators that occur at the same precedence level within an expression, evaluation proceeds left to right, with the exception that assignments evaluate right to left. The precedence of  =  depends on whether it is used as a comparison operator ( = ) or as an assignment operator ( = ). When used as a comparison operator, it has the same precedence as  <=> ,  >= ,  > ,  <= ,  < ,  <> , != ,  IS ,  LIKE ,  REGEXP , and  IN() . When used as an assignment operator, it has the same precedence as := . Section 13.7.6.1, “SET Syntax for Variable Assignment” , and Section 9.4, “User-Defined Variables” , explain how MySQL determines which interpretation of  =  should apply.