Order BY String, not ordering correct alphabetical
694764Nov 17 2009 — edited Nov 17 2009Hey,
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.