Distanza fra due punti select p1.longitude, p1.latitude, p2.longitude, p2.latitude, ST_Distance( ST_GeomFromText('POINT(' || p1.longitude || ' ' || p1.latitude || ')',4326), ST_GeomFromText('POINT(' || p2.longitude || ' ' || p2.latitude || ')',4326)) as distance from places p1, places p2 where p1.id = p2.id and p1.id = 1 and p2.id != 1