NLSSORT returns a collation key for the character value char and an explicitly or implicitly specified collation. A collation key is a string of bytes used to sort char according to the specified collation. The property of the collation keys is that mutual ordering of two such keys generated for the given collation when compared according to their binary order is the same as mutual ordering of the source character values when compared according to the given collation.. (NLSSORT in Oracle).
CREATETABLEtest (nameVARCHAR2(15));INSERT INTO test VALUES ('Gaardiner');INSERT INTO test VALUES ('Gaberd');INSERT INTO test VALUES ('Gaasten');SELECT*FROM testORDER BY NLSSORT(name, 'NLS_SORT = XDanish');
Result:
NAME
-------
Gaberd
Gaardiner
Gaasten
Code:
CREATE OR REPLACETABLEtest (nameVARCHAR(15))COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
;INSERT INTO testVALUES ('Gaardiner');INSERT INTO testVALUES ('Gaberd');INSERT INTO testVALUES ('Gaasten');SELECT*FROM testORDER BYCOLLATE(name, '');