вопрос по IF(expr1, expr2, expr3) AS nnn

nalevo

Новичок
вопрос по IF(expr1, expr2, expr3) AS nnn

Доброго времени суток.
Не могу понять почему не работает вот такая выборка:
SELECT IF(2>1, 1, 0) AS nnn FROM table WHERE nnn=1

Пишет Unknown column 'nnn' in 'where clause'
MySQL version: 4.1.5-gamma
 

Сергей123

Новичок
The alias is used as the expression's column name and can be used with ORDER BY or HAVING clauses.

-~{}~ 20.10.04 13:20:

It is not allowed to use a column alias in a WHERE clause, because the column value may not yet be determined when the WHERE clause is executed.
 
Сверху