PostgreSQL: Documentation: 10: 7.8. WITH Queries (Common Table Expressions)
- https://www.postgresql.org/docs/10/static/queries-with.html#QUERIES-WITH-SELECT
WITH
provides a way to write auxiliary statements for use in a larger query. These statements, which are often referred to as Common Table Expressions or CTEs, can be thought of as defining temporary tables that exist just for one query. Each auxiliary statement in aWITH
clause can be aSELECT
,INSERT
,UPDATE
, orDELETE
; and theWITH
clause itself is attached to a primary statement that can also be aSELECT
,INSERT
,UPDATE
, orDELETE
.
Calculate min distance between points in PostGIS - Geographic Information Systems Stack Exchange
- https://gis.stackexchange.com/questions/52792/calculate-min-distance-between-points-in-postgis
ST_Distance
- http://postgis.net/docs/manual-2.4/ST_Distance.html
- ST_Distance — For geometry type Returns the 2D Cartesian distance between two geometries in projected units (based on spatial ref). For geography type defaults to return minimum geodesic distance between two geographies in meters.
Boundless : Introduction to PostGIS : 27. Nearest-Neighbour Searching
- http://workshops.boundlessgeo.com/postgis-intro/knn.html
Boundless : Introduction to PostGIS : 29. Advanced Geometry Constructions
- http://workshops.boundlessgeo.com/postgis-intro/advanced_geometry_construction.html