Subject Re: Stupid Programmer or a bug?
Author rogervellacott
You must group by all the non-aggregating fields, not the aggregating
ones.

select zone, description, count(description) as calls, sum(duration)
from report
group by zone,description

Roger Vellacott
Passfield Data Systems Ltd


--- In firebird-support@yahoogroups.com, "Dalton Calford"
<dcalford@...> wrote:
>
> Ok, I have to admit it has been a very long time since I used
group by,
> so I am admitting that this may be my fault from the start
but.......
>
> I have a table (report), with four columns
>
> Zone integer
> Description varchar(50)
> StartTime timestamp
> Duration integer
>
>
> So I use IB_SQL to create a simple query
>
> select zone, description, count(description) as calls, sum
(duration)
> from report group by calls order by description
>
> I try to prepare the query, but instead of an error, I get
nothing.
> IB_SQL looks to be waiting for the server to return but the
server's CPU
> is sitting at 0%.
>
> Please someone, tell me that I am just having an off day and that I
have
> not found a bug in the group by code in Firebird 1.53
> (and If it is me, what the %&$^ am I doing wrong - I think I need
more
> coffee)
>
> Best regards
>
> Dalton
>