Subject Re: [firebird-support] [Qry][Err:-206]Column does not belong to referenced table
Author Alexandre Benson Smith
Andrea Raimondi wrote:
> Hello.
>
> This is a prettily tricky query in fact.
> Here it is:
>
> select Messages.*,avg(MessageRatings.ratingvalue) as AvgRate
> from Messages
> join messageratings mg on mg.message_id = Messages.message_id
> group by AvgRate
>
>
Andrea,

Put every column (Messages.*) on the GROUP BY clause and then ORDER BY avg

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br