List:General Discussion« Previous MessageNext Message »
From:Naz Gassiep Date:September 15 2007 12:25am
Subject:Problem with query
View as plain text  
I am running this query:

SELECT group_post_mod_option.option_id, 
       group_post_mod_option.option_name, 
       COUNT(group_post_moderation.group_post_moderation_option) AS count 
FROM group_post_mod_option 
LEFT OUTER JOIN group_post_moderation ON 
            (group_post_mod_option.option_id =
group_post_moderation.group_post_moderation_option 
             AND group_post_moderation.group_post_id = 37) 
GROUP BY group_post_mod_option.option_id 
ORDER BY COUNT(group_post_moderation.group_post_moderation_option), 
         group_post_mod_option.option_name;
 
 
And getting this error:
'Invalid use of group function'

Without the "ORDER BY" clause, the query works just fine. Anyone know what's going on?

Regards,
- Naz.

Thread
Problem with queryNaz Gassiep15 Sep
  • Re: Problem with queryPeter Brawley15 Sep