469,939 Members | 2,345 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,939 developers. It's quick & easy.

Can it be done better?

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,l on) 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,l on) AS dist
FROM radio_stations_tbl AS rfc, zipcodes_tbl AS zipt
WHERE zipt.zip=92627 AND
earth_distance_miles(zipt.latitude,longitude,lat,l on)<50
ORDER BY rank DESC, dist;

but is it not cosing distance to be calculated twice?
Oct 29 '06 #1
0 1854

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Joshua Beall | last post: by
21 posts views Thread by John Lin | last post: by
24 posts views Thread by Xah Lee | last post: by
13 posts views Thread by Alexei A. Frounze | last post: by
3 posts views Thread by Mike | last post: by
12 posts views Thread by Ark | last post: by
7 posts views Thread by Andy Bell | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.