SELECT city, state, SQRT( POWER( (
latitude - 39.039200
), 2 ) + POWER( (
longitude + 95.689508
), 2 ) ) AS distance
FROM geographics
WHERE distance <1
ORDER BY distance
LIMIT 10;

Returns:
#1054 - Unknown column 'distance' in 'where clause' 

Are alias not allowed in WHERE clauses?  

I am able to replace the alias with the entire math function, and it
works as desired.  However, I do not like the heaviness/repetiveness
of the query.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to