Sql-docs: STContains vs. STWithin vs. STIntersects?

Created on 2 May 2019  Â·  3Comments  Â·  Source: MicrosoftDocs/sql-docs

It would be nice if the documentation explicitly addressed why there are multiple ostensibly similar functions. Since STIntersects' existence presumably rules out partial vs. strict subset, I can't think of any other English-based meaning difference between STWithin and STContains.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

product-question sqprod t-sqtech

All 3 comments

Thank you @eliotg - again - I'll find the answer.

Still monitoring.

Here's the answer that I got back:)

Functions starting with ST are OGC standardized function calls that can be found in other implementations of OGC spec as well in similar forms (e.g. ST_Within, ST_Contains, in PostgreSQL, Oracle, etc)

Also, I don’t see any language ambiguity when saying if A CONTAINS B, then B is WITHIN A, i.e.

a.STWithin(b) == b.STContains(a)

Was this page helpful?
0 / 5 - 0 ratings