Bug #22371 Query error when I use "as"
Submitted: 15 Sep 2006 0:06 Modified: 15 Sep 2006 9:07
Reporter: Ruben Ruiz Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S5 (Performance)
Version:5 OS:Windows (windows xp)
Assigned to: CPU Architecture:Any

[15 Sep 2006 0:06] Ruben Ruiz
Description:
MySQL server don't recognice the new name (total) of column when I using the "where total > 10" 

How to repeat:
Using the example database "world" on mysql.com downloads:

use world;
Database changed

SELECT count(*) as total, governmentform FROM country
where total > 10
group by Governmentform
order by cuantos desc;

ERROR 1054 (42S22): Unknown column 'total' in 'where clause'
[15 Sep 2006 9:07] Valeriy Kravchuk
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php