hi there!
it seems logical to me that using CASE...END in an ORDER BY clause ought
to work. i can set up a CASE statement in a SELECT:
SELECT CASE test.ID WHERE 1 THEN 2 WHERE 2 THEN 1 END AS c
and i get the expected output. however, if i then try to move the whole
case statement into the clause (ORDER BY CASE test.ID...END), then mysql
seems to completely ignore the CASE...END instead; i.e. the table is
sorted as it would be without the CASE...END (if i do ORDER BY CASE
test.ID...END, test.name - then it will simply be ordered by test.name).
additionally, if i leave the SELECT CASE...END AS c and then try to
ORDER BY c, mysql complains that column c is not known.
any ideas on what i'm missing here? this is using 3.23.32, compiled
today. it did the same thing with a .27-gamma release.
thanks.
-damon
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php