XQuery distinct-values removes repeated atomic values rather than selecting representative source nodes. I rebuild a small sorted XML result from repeated text. The example also keeps an empty document in view.
ACOS: Check the Cosine Domain Before Calculating Angles
ACOS calculates an angle from a supported cosine ratio. Keep invalid and missing inputs visible while displaying valid radians at a chosen scale.
PERCENT_RANK Versus CUME_DIST: What Ties Change
PERCENT_RANK versus CUME_DIST answers different ranking questions. Keep peers intact and compare missing scores and singleton groups.
CHARINDEX Start Position: Find the Second Delimiter
CHARINDEX start position finds the next delimiter. Guard a missing first match, preserve NULL, and extract empty fields without negative lengths.
EOMONTH: Month Ends Are Different From DATEADD Month Clipping
EOMONTH gives me a month-end date when that is the actual reporting requirement. DATEADD moves a date by a month. These operations can agree for one step and disagree on the next.
TAN: Keep the Angle Away From Its Undefined Point
TAN reads radians and returns float. These safe angles demonstrate sign and magnitude while explaining why a large finite float near ninety degrees is not a meaningful infinity.
PATINDEX and CHARINDEX: Pattern or Literal Search
PATINDEX and CHARINDEX answer different questions. Compare wildcard patterns with literal searches, preserve NULL, and pin collation for digit ranges.







