Subject Re: [ib-support] Proble with GROUP BY in SELECT
Author Ann W. Harrison
At 04:52 PM 6/6/2001 +0000, alfredm80@... wrote:

>I have problems with the this select-sql statement:
>
>select * from dgcb group by numero order by numero;
>
>The error is:
>
>Dynamic SQL error
>SQL Error code = - 104
>Invalid column Reference
>Statement: select * from dgcb group by numero order by numero

The SQL standard says that in a grouped query, you can select
only the grouping field(s) or aggregates. If you have any field
in dgcb other than numero, you must reference it through an
aggregate expression

select numero, max (name), max (address), max (phone)

from dgcb group by numero order by numero;


Regards,

Ann
www.ibphoenix.com
We have answers.