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!

Order BY String, not ordering correct alphabetical

694764Nov 17 2009 — edited Nov 17 2009
Hey,

I have the following query.

SELECT TBLREQUESTTYPES.ID, TYPE_NAME, SCHEDULED, CASE WHEN SCHEDULED = 1 THEN 'No' ELSE 'Yes' END AS SCHEDULEDTEXT, DAYS, CASE WHEN SCHEDULED = 1 THEN DAYS ELSE NULL END AS NUMDAYS, CASE WHEN SCHEDULED = 1 THEN 'Unscheduled' ELSE TBLFREQUENCIES.NAME END AS FREQUENCY, TBLFREQUENCIES.NAME FROM TBLREQUESTTYPES LEFT JOIN TBLFREQUENCIES ON TBLREQUESTTYPES.FREQUENCYID = TBLFREQUENCIES.ID WHERE TBLREQUESTTYPES.STATUS_ID = 1
ORDER BY TYPE_NAME DESC

But the list is for example is if there is 20 records
first 10 are correct a-z but then next 10 are a-z again instead of all 20 being listed correctly a-z.

If i do for example order by id it works fine.
This post has been answered by Frank Kulash on Nov 17 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 15 2009
Added on Nov 17 2009
6 comments
1,314 views