The preference keyword and the order by clause

A collating sequence file that is not case sensitive can use a preference entry to indicate whether letters to the left of the equal sign should sort before letters to the right of the equal sign when sorting output generated as the result of a select statement with an order by clause.

For example, suppose that a collating sequence file contains the following entries:

char = A=a, Á=á
char = B=b

If preference=true, then order by output will sort as follows:

Aab
aAb
Aáb

If preference=false, then order by output can sort either as:

aAb
Aab
Aáb

or

Aab
aAb
Aáb

The preference keyword:

If preference=true, then characters to the left of the equal sign sort first. If preference=false, then characters to the left of the equal sign may not sort first.

The preference keyword has a default value of “true.” That is, if a collating file does not contain a preference entry, order by sorts give precedence to characters to the left of the equal sign.

Most typically, preference=true means that uppercase characters sort before lowercase characters.