Can it be done better?
am 29.10.2006 02:50:43 von ralphChow can i do something like that:
SELECT
rfc.radioid,
rank,
CONCAT_WS(' ', rfc.fac_callsign, rfc.fac_service, rfc.fac_frequency) AS
callsign,
earth_distance_miles(zipt.latitude,longitude,lat,lon) AS dist
FROM radio_stations_tbl AS rfc, zipcodes_tbl AS zipt
WHERE zipt.zip=92627 AND dist<50
ORDER BY rank DESC, dist;
earth_distance_miles i a function. I'm getting errors trying to execute
this query.
I could do like this:
Chow can i do something like that:
SELECT
rfc.radioid,
rank,
CONCAT_WS(' ', rfc.fac_callsign, rfc.fac_service, rfc.fac_frequency) AS
callsign,
earth_distance_miles(zipt.latitude,longitude,lat,lon) AS dist
FROM radio_stations_tbl AS rfc, zipcodes_tbl AS zipt
WHERE zipt.zip=92627 AND
earth_distance_miles(zipt.latitude,longitude,lat,lon)<50
ORDER BY rank DESC, dist;
but is it not cosing distance to be calculated twice?