Subject Re: [firebird-support] How to return the value of a sub-query as a field in the resulting table
Author Cornie van Schoor
On 2011/04/07 22:21, Alexandre Benson Smith wrote:
>
> Em 7/4/2011 17:07, cornievs escreveu:
> > Select A.CLIENT, B.NAME, SUM(A.POINTS) FROM POINTS A JOIN CLIENTS B
> ON A.CLIENT = B.CODE WHERE A.PROMOTION = 3 GROUP BY A.CLIENT
>
> every filed that is not an aggregate must be in the group list.
>
> Select A.CLIENT, B.NAME, SUM(A.POINTS) FROM POINTS A JOIN CLIENTS B ON
> A.CLIENT = B.CODE WHERE A.PROMOTION = 3 GROUP BY A.CLIENT, B.Name
> order by A.Client
> Select A.CLIENT, B.NAME, SUM(A.POINTS) FROM POINTS A JOIN CLIENTS B ON
> A.CLIENT = B.CODE WHERE A.PROMOTION = 3 GROUP BY A.CLIENT, B.Name
> order by B.Name
> Select A.CLIENT, B.NAME, SUM(A.POINTS) FROM POINTS A JOIN CLIENTS B ON
> A.CLIENT = B.CODE WHERE A.PROMOTION = 3 GROUP BY A.CLIENT, B.Name
> order by 3
>
> see you !
>
> _
Thanks! Works

Just a question: Why must "every filed that is not an aggregate must be
in the group list"?

Regards


Cornie


[Non-text portions of this message have been removed]