Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Having trouble sorting / ordering query results by multiple fields

NewApexCoderJun 10 2014 — edited Jun 11 2014

I have a list of values that I need to have sorted numerically in decending order and then alphabetically. My query is along the lines of

Select type, epoch

From MY_TABLE

Where Id = 1409

Order by type asc, epoch

The results yeilded are:

BTLWRP     1970

CAIRO         2006.81

MLG            1970

MLLW         1938

MLLW         2006.81

NAVD88      2006.81

NAVD88      2009.55

NAVD88      ALWRP_2000

NGVD29      1951

NGVD29      1994

NGVD29       2004.65

NGVD29       2009.55

Clearly these aren't sorted numerically in descending order and then alphabetically. I have tried using case statements in the order by clause and have also tried NLS_SORT but nothing seems to be working.

Any help on this would be greatly appreciated. Thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 9 2014
Added on Jun 10 2014
7 comments
605 views