Why doesn\'t the following query work? Mysql complains about z - can\'t I use an alias in the WHERE clause?
SELECT x + y AS z, t.* FROM t WHERE x = 1 and z
Use having clause:
SELECT (x + y) AS z, t.* FROM t WHERE x = 1 having z=2