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 02, 2006 10:41AM

I'm sorry but upon running this query

SELECT s.id, s.student_first_name, s.student_mi, s.student_last_name,

IF(s.school_year_id = 0, s.school_year_other, y.school_year_alt_display) AS school_year_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),
e.ethnicity_name) AS ethnicity_name

FROM student s, completion_comments cc, ethnicity e, student_ethnicity_interest_assoc seia

LEFT OUTER JOIN school_year y on s.school_year_id = y.id

WHERE s.has_completion_reference_letter1 = cc.has_reference_letter1
AND s.has_completion_reference_letter2 = cc.has_reference_letter2
AND s.has_school_transcript = cc.has_school_transcript
AND s.id = seia.student_id
AND seia.ethnicity_id = e.id

GROUP BY s.id

ORDER BY upper(GROUP_CONCAT(ethnicity_name)) asc, upper(s.student_last_name) asc, upper(s.student_first_name) asc, upper(s.student_mi) asc

I get the following error:

ERROR 1111 (HY000): Invalid use of group function

Phil

Options: ReplyQuote


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


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.