Skip to content Skip to sidebar Skip to footer

How To Hide An Alias Column In Mysql Edited

I know this is a replica of some question asked already, but i need some suggestion. I know basics of MySQL, i have a query to calculate distance between latitude and longitude and

Solution 1:

You would want to use a subquery:

select wp_id
from (select cl.wp_id,( 3959*acos( cos( radians(12.91841) ) *cos( radians( y(gproperty) ) ) *cos( radians( x(gproperty)) - radians(77.58631) ) +sin( radians(12.91841) ) *sin( radians(y(gproperty) ) ) ) ) AS distance
      from db1.geofeature gf join
           db2.c_loc cl 
           on gf.o_type =256and cl.c_info_id =146and gf.o_id = cl.wp_id
    ) t
where distance <10orderby distance
limit 10;

Notice that I also fixed the join syntax to use explicit joins.

Post a Comment for "How To Hide An Alias Column In Mysql Edited"