(Preface: In the past, this might have been a typical "Glenn will answer that" question...)
For SQL Anywhere, the docs clarify the following:
(And consequently, NULL sorts after all other values in descending sort order, although that is not documented.)
The same seems to be true for MS SQL Server.
Question: Is this a standardized SQL behaviour or is this still implementation-specific - i.e. can I rely on that in general?
OK, some web search seems to imply that this really is implementation-specific - to cite Wikipedia:
For example, ORACLE seems to behave differently (NULLS LAST if the sort is ASC, NULLS FIRST otherwise) but lets you control this by adding "NULLS LAST" / "NULLS FIRST" to the ORDER BY expression.
AFAIK, SQL Anywhere does not yet offer the NULLS FIRST / NULLS LAST option.
Resume: Don't expect too much standardization:)
answered 07 Aug '13, 09:07