A script-enabled browser is required for this page to function properly.

Controlling an ORDER BY Clause

If a linguistic sorting sequence is in use, then NLSSORT is implicitly used on each character item in the ORDER BY clause. As a result, the sort mechanism (linguistic or binary) used for an ORDER BY is transparent to the application.

However, if the NLSSORT function is explicitly specified for a character item in an ORDER BY item, then the implicit NLSSORT is not done. In other words, the NLSSORT linguistic replacement is only applied once, not twice.

The NLSSORT function is generally not needed in an ORDER BY clause, when the default sort mechanism is a linguistic sort. However, when the default sort mechanism is binary, then a query such as:

SELECT ENAME FROM EMP

ORDER BY ENAME

will use a binary sort. A linguistic sort (for German in the example below) can be obtained using:

SELECT ENAME FROM EMP

ORDER BY NLSSORT(ENAME, ’NLS_SORT = GERMAN’)