MySQL: Using AS-variable in WHERE
how can i use the age-field in the WHERE-clause later?
SELECT DISTINCT(TIMESTAMPDIFF(YEAR, birthday, CURDATE())) AS age FROM table WHERE age>=16 ORDER BY age ASC
It results in a #1054 error (table field "age" unknown).
Thanks!