I have installed spatialite on my PC and tried some sql queries on command line, it worked fine, but when I do this, it won't work :
Select place_id,place_name,lat,lon, ( 6371 * acos( cos( radians( -6.845830100000001 ) ) * cos( radians( lat ) ) * cos( radians( lon ) - radians( 107.4736016) ) + sin( radians( -6.845830100000001 ) ) * sin( radians( lat ) ) ) ) as dist FROM pois group by place_name HAVING dist < 3 limit 10;
If I remove HAVING dist < 3 then this works fine :
Select place_id,place_name,lat,lon, ( 6371 * acos( cos( radians( -6.845830100000001 ) ) * cos( radians( lat ) ) * cos( radians( lon ) - radians( 107.4736016) ) + sin( radians( -6.845830100000001 ) ) * sin( radians( lat ) ) ) ) as dist FROM pois group by place_name HAVING dist < 3 limit 10;
What do you think? what is the problem?