Introduction
ST_Equals
Relationships Between Geometries
ST_Distance and ST_Dwithin
Spatial joins practice
22. Spatial functions inside aggregates - exercise
Summary

Instruction

Perfect! One more exercise coming your way.

Exercise

For each district, show its name and the length of the longest railway track that intersects with it. Sort the results by length in descending order. Show the length in kilometers.

Stuck? Here's a hint!

Use MAX(...) with ST_Length(...) as its argument. Don't forget to use ST_Transform.

Console

Code editor

Result

TableConsole