Test if the ST_Curve value is closed. A curve is closed if the start and end points are coincident.
SELECT * FROM SpatialShapes WHERE IF Shape IS OF ( ST_Curve ) AND TREAT( Shape AS ST_Curve ).ST_IsClosed() = 1 THEN 1 ENDIF = 1
The following returns all rows in curve_table that have closed geometries. This example assumes the geometry column has type ST_Curve, ST_LineString, ST_CircularString or ST_CompoundCurve.
SELECT * FROM curve_table WHERE geometry.ST_IsClosed() = 1
SQL/MM (ISO/IEC 13249-3: 2006) 7.1.5