Description\n-----------\n\nThe precedence is the order in which the SQL operators are evaluated.\n\nThe following list shows the SQL operator precedence. Operators that appear first in the list have a higher precedence. Operators which are listed together have the same precedence.\n\n INTERVAL\n BINARY, COLLATE\n !\n - (unary minus), bitwise not (unary bit inversion)\n || (string concatenation)\n ^ (bitwise XOR)\n \\, /, DIV, %, MOD (multiplication, division, modulo)\n -, + (subtraction, addition)\n <<, >>\n & (bitwise AND)\n | (bitwise OR)\n LIKE, REGEXP, IN\n BETWEEN\n = (comparison), <=>, >=, >, <=, <, <>, !=, IS\n NOT\n &&, AND\n XOR\n || (logical or), OR\n = (assignment), :=\n\nFunctions precedence is always higher than operators precedence.\n\nIf the HIGH_NOT_PRECEDENCE SQL_MODE is set, NOT has the same precedence as !.\n\nThe || operator's precedence, as well as its meaning, depends on the PIPES_AS_CONCAT SQL_MODE flag: if it is on, || can be used to concatenate strings (like the CONCAT() function) and has a higher precedence.\n\nThe = operator's precedence depends on the context - it is higher when = is used as a comparison operator.\n\nParentheses can be used to modify the operators precedence in an expression.\n\nShort-Circuit Evaluation\n\nThe AND, OR, && and || operators support short-circuit evaluation. This means that, in some cases, the expression on the right of those operators is not evaluated, because its result cannot affect the result. In the following cases, short-circuit evaluation is used and x() is not evaluated:\n\n FALSE AND x()\n FALSE && x()\n TRUE OR x()\n TRUE || x()\n* NULL BETWEEN x() AND x()\n\nNote however that the short-circuit evaluation does _not_ apply to NULL AND x(). Also, BETWEEN's right operands are not evaluated if the left operand is NULL, but in all other cases all the operands are evaluated.\n\nThis is a speed optimization. Also, since functions can have side-effects, this behavior can be used to choose whether execute them or not using a concise syntax:\n\n``sql\nSELECT some_function() OR log_error();\n``\n\nURL: https://mariadb.com/docs/server/reference/sql-structure/operators/operator-precedence