I have my sort ordering in Sybase as: 45 190 altdict - Alternate (lower-case first) dictionary ordering Am I right that alternate means "aAbBcC..zZ" ordering?

What should I do to change ordering with "ORDER BY" as 'ABC..YZabc..yz' ? What sort ordering to choose?

Where may it be changed? In a session? In SQL statement? as far as I know I need to change the whole server sort ordering and rebuilt indexes. But there are a bunch of databases with different owners and different users and it seems a bit extreme

  • Which Sybase RDBMS (ASE? IQ? SQLAnywhere? Advantage?) are you running?
    – markp-fuso
    Feb 6, 2020 at 16:33
  • @markp it's ASE 15.7 Feb 6, 2020 at 16:37

1 Answer 1


The ASE dataserver is configured with a single sort order; see selecting default sort order.

For scenarios where the user needs to use a sort order different from the dataserver's default sort order there is:

  • sortkey() - allows for sorting data by a user-selected sort order
  • thank you, that totally answers my question "select * from aksenov_test order by sortkey(a, 50) desc" works perfect Feb 7, 2020 at 17:00
  • good to hear; I don't recall having used sortkey() before so it's good to know something works as advertised in the documentation! :-)
    – markp-fuso
    Feb 7, 2020 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.