Nico
Nico

Reputation: 181

Order By on cyrillic letters

I want to provide a correct ordered list of names.

My question: is the SQL ORDER BY clause the best way to provide correct ordered strings in multiple languages or are there some problems which should be considered?

I just tested it with Russian letters and it seems to work.

Upvotes: 2

Views: 2424

Answers (3)

user2067376
user2067376

Reputation: 2647

SELECT * FROM your_table ORDER BY nlssort(your_column, 'NLS_SORT=russian');

Upvotes: 0

Krupa Patel
Krupa Patel

Reputation: 3359

SQL order by clause is the best way to show correct ordered list of names.

Upvotes: -1

podiluska
podiluska

Reputation: 51494

The sorting of a column depends on the collation in use for that column, or the optional collation applied to that sort - ie: ORDER BY {column name} COLLATE {collation name}

You would be advised to pick a collation that meets your requirements, perhaps Cyrillic_General_CI_AS

See http://msdn.microsoft.com/en-us/library/ms143508(v=sql.105).aspx

Upvotes: 4

Related Questions