Skip to main content
Participant
June 6, 2006
Question

Order By clause is ignoring LowerCase field name

  • June 6, 2006
  • 1 reply
  • 297 views
I am trying to use a QoQ, but am running into a problem when using the order by clause...

All the fieldvalues in the order by field start with uppercase except for one, and this field name gets thrown to the end of the list

Anyone got any ideas???

thanks

Sujit
This topic has been closed for replies.

1 reply

June 6, 2006
Before you try the following, please note that you can clean this up in your original DB queries -- which is almost always better.

Anyway, suppose your QofQ was:
SELECT MixcasedColumn
FROM SomeQuerySet
ORDER BY MixcasedColumn

Then you would add a dummy column to use for case-insensitive sort:
SELECT
MixcasedColumn, UPPER (MixcasedColumn) AS SortColumn
FROM
SomeQuerySet
ORDER BY
SortColumn <!--- Note that upper() is not allowed here but derived columns are! --->