On 7/10/06, Bryce Nesbitt <bryce1@obviously.com> wrote:
I think it is ugly also, but no other syntax seems to work:
stage=# select
pod_code,lat,lon,calculate_distance(lat,lon,37.789629,-122.422082) as
dist from eg_pod where dist < 1 order by dist desc limit 10;
ERROR: column "dist" does not exist
SELECT
pod_code,
lat,
lon,
calculate_distance(lat,lon,37.789629,-122.422082) as dist
FROM eg_pod
WHERE calculate_distance(lat,lon, 37.789629,-122.422082) < 1
ORDER BY calculate_distance(lat,lon,37.789629,-122.422082) desc limit 10;