MySQL supports transpositions (reversing the order of operands around a relational operator) for simple expressions only. In other words:
WHERE - 5 = column1
becomes:
WHERE column1 = -5
However, MySQL does not support transpositions where arithmetic exists. Thus:
WHERE 5 = -column1
is not treated the same as:
WHERE column1 = -5
Transpositions to expressions of the form
are ideal for
index lookups. If an expression of this form refers to an
indexed column, then MySQL always uses the index, regardless of
the table size. (Exception: If
the table has only zero rows or only one row, it is a constant
table and receives special treatment. See
Section 7.2.1.4, “Constants and Constant Tables”.)
column
=
constant