MySQL Forums
Forum List  »  InnoDB

Re: Sort (ORDER BY) by a comma-separated list of related fields using MySQL 4.1?
Posted by: Phil Powell
Date: March 06, 2006 02:02PM

Took an entire weekend but I finally got it, and thanks to you and 3 other DBA friends of mine, and a MySQL book, and online tutorials, and prayer.. I got it

select id, student_first_name...

' ' .
" IF(s.student_ethnicity_interest_other IS NOT NULL AND s.student_ethnicity_interest_other != '', " .
" CONCAT(s.student_ethnicity_interest_other, ', ', e.ethnicity_name), " .
' GROUP_CONCAT(e.ethnicity_name ORDER BY upper(e.ethnicity_name))' .
' ) AS ethnicity_name ' .


..
GROUP BY id, student_first_name [and don't include ethnicity_name]
ORDER BY upper(trim(ethnicity_name)) ASC..

Phil

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Sort (ORDER BY) by a comma-separated list of related fields using MySQL 4.1?
2181
March 06, 2006 02:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.