Subject Re: [ib-support] group by doesn't work
Author Claudio Valderrama C.
""guntersammet"" <gunter@...> wrote in message
news:a1aa46+knsq@......
> I tried to execute following sql statement and a get an invalid
> column reference error:
>
> SELECT table1.column1,table1join.joinColumn1,table1join.joinColumn2
> FROM table1 LEFT OUTER JOIN table1join ON
> table1.column1=table1join.joinColumn0 WHERE table1.column1 >= 0
> GROUP BY table1.column1

You don't know how group works. Using fields in the SELECT part that don't
appear in the GROUP BY part is grouping error and the engine will do any
attempt to detect and reject such syntax. This is invalid:

select a, b
from tbl
group by a

This is valid:
select a, b
from tbl
group by a, b

This is valid:
select a, avg(b)
from tbl
group by a

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing