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

Comparing Strings Example

Suppose you have a column (COL1) that contains the values ABC, ABZ, BCD and ÄBC in the ISO 8859/1 8-bit character set. Suppose also, that you wrote the following query:

SELECT COL1 FROM TAB1 WHERE COL1 > 'B'

The query would return both BCD and ÄBC since Ä has a higher numeric value than B.

You can perform linguistic comparisons using NLSSORT in the WHERE clause, as follows:

WHERE NLSSORT(column) operator NLSSORT(string)

Notice that NLSSORT has to be used on both sides of the comparison operator.

SELECT COL1 FROM TAB1 WHERE NLSSORT(COL1) > NLSSORT('B')

If a German linguistic sort is being used, this will not return strings beginning with Ä, because Ä comes before B in the German alphabet. If a Swedish linguistic sort is being used, those strings would be returned, because Ä comes after Z in the Swedish alphabet.