472,141 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

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 1880

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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.