Subject | Re: [firebird-support] [Qry][Err:-206]Column does not belong to referenced table |
---|---|
Author | Alexandre Benson Smith |
Post date | 2006-02-08T21:39:14Z |
Andrew,
Andrea Raimondi wrote:
select
M.Message_ID, M.Date, M.Suject, M.Sender, M.To, avg(MR.RatingValue)
from
from
Messages M join
MessageRatings MR on (MR.Message_id = M.message_id)
group by
M.Message_ID, M.Date, M.Suject, M.Sender, M.To
order by
6
note that "6" are the position of the columns that has the average value.
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
Andrea Raimondi wrote:
> Like this?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
>
select
M.Message_ID, M.Date, M.Suject, M.Sender, M.To, avg(MR.RatingValue)
from
from
Messages M join
MessageRatings MR on (MR.Message_id = M.message_id)
group by
M.Message_ID, M.Date, M.Suject, M.Sender, M.To
order by
6
note that "6" are the position of the columns that has the average value.
>see you !
> Cheers,
>
> Andrew
>
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br