-- Return distance between two points using spatial distance method
SELECT "Column1".ST_Distance("Column2")
FROM Table
ORDER BY "Column1".ST_Distance("Column2") DESC
-- Filter on distance between 2 points
SELECT SUM(sales)
FROM Table
WHERE "Column1".ST_Distance("Column2") > n
ORDER BY "Column1".ST_Distance("Column2") DESC
-- Filter on points within a region
SELECT SUM(sales)
FROM Table
WHERE "Column1_point".ST_Within("region") = 1 --1 for true, 0 for untrue