Forum Moderators: open
SELECT column1, column2, column3 / 100 AS alternate_name FROM table_name WHERE alternate_name > 10;
This fails for "Unknown column 'alternate_name' in 'where clause'"
For some reason I can use alternate_name in the ORDER BY clause but not WHERE clause. What can I do to reference this column in the WHERE clause? Is it possible?
I'm not 100% positive about the logic behind this, but you can think of it as 2 different operations:
1) SELECT the data
2) ORDER the result set of data
By the time step 2 processes, "alternate_name" is defined, but "alternate_name" is not defined in the begining of step 1.