Tests if an ST_Geometry value is spatially equal to another ST_Geometry value.
SELECT ShapeID FROM SpatialShapes WHERE Shape.ST_Equals( NEW ST_Polygon( 'Polygon ((2 0, 1 2, 0 0, 2 0))' ) ) = 1
The following example returns the result 1, indicating that the two linestrings are equal even though they contain a different number of points specified in a different order, and the intermediate point is not exactly on the line. The intermediate point is about 3.33e-7 away from the line with only two points, but that distance less than the tolerance 1e-6 for the "Default" spatial reference system (SRID 0).
SELECT NEW ST_LineString( 'LineString( 0 0, 0.333333 1, 1 3 )' ) .ST_Equals( NEW ST_LineString( 'LineString( 1 3, 0 0 )' ) )
SQL/MM (ISO/IEC 13249-3: 2006) 5.1.24