Test if a geometry intersects a rectangle.
SELECT LIST( ShapeID ORDER BY ShapeID ) FROM SpatialShapes WHERE Shape.ST_IntersectsRect( NEW ST_Point( 0, 4 ), NEW ST_Point( 2, 5 ) ) = 1
The following example tests if a linestring intersects a rectangle. The provided linestring does not intersect the rectangle identified by the two points (even though the envelope of the linestring does intersect the envelope of the two points).
SELECT NEW ST_LineString( 'LineString( 0 0, 10 0, 10 10 )' ) .ST_IntersectsRect( NEW ST_Point( 4, 4 ) , NEW ST_Point( 6, 6 ) )
SQL/MM (ISO/IEC 13249-3: 2006) Vendor extension