I want to create a function which check if there a any locations within a certain distance from a waypoint. the function to calculate the distance is already working. I start with the query shown below.
select loc_id from wp where calc_distance(52.15819, 6.40726, wp.lat, wp.lon) <100;
This query wil result in several rows, the next step would be to count the amount of rows, why won't the query below result in a number?
select count(loc_id from wp where calc_distance(52.15819, 6.40726, wp.lat, wp.lon) <100);
Any thoughts?
Small side question: What wuold be perferred:
TIA
ABBOV
Syntax error is all. You need a closing parenthesis after loc_id
select count(loc_id) from wp where calc_distance(52.15819, 6.40726, wp.lat, wp.lon) <100;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.