Subject Re: [firebird-support] [Qry][Err:-206]Column does not belong to referenced table
Author Andrea Raimondi
Alexandre Benson Smith wrote:
> Andrea,

Alexandre,

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

Like this?

select Messages.*,avg(MessageRatings.ratingvalue) as AvgRate from Messages
join messageratings mg on mg.message_id = Messages.message_id
group by Messages.* order by AvgRate

If you mean something like the above, then it doesn't work.
Same error, same message.

> see you !

Cheers,

Andrew