Collation Order in an ORDER BY Clause

From InterBase
Jump to: navigation, search

Go Up to Sorting Rows with ORDER BY


When CHAR or VARCHAR columns are ordered in a SELECT statement, it can be necessary to specify a collation order for the ordering, especially if columns used for ordering use different collation orders.

To specify the collation order to use for ordering a column in the ORDER BY clause, include a COLLATE clause after the column name. For example, in the following ORDER BY clause, a different collation order for each of two columns is specified:

. . .
ORDER BY LNAME COLLATE FR_CA, FNAME COLLATE FR_FR;

For more information about collation order and a list of available collations in InterBase, see the Data Definition Guide.