Subject Re: Aggregate functions
Author donjules2k
True, thats just me being dumb when I wrote the example. But the point
I was trying to make is that I can't use labels. Seems the same
applies to order by.

Giulio

--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 09:30 AM 5/06/2004 +0000, you wrote:
> >Hi,
> >
> >I want to do something like
> >
> >select sum(a) as total, b
> >from MYTABLE
> >where b like 'whatever%'
> >having total > 0
> >
> >But it moans at me using the labels. I know it works without the
> >labels, as in this works:
> >
> >select sum(a) as total, b
> >from MYTABLE
> >where b like 'whatever%'
> >having sum(a) > 0
> >
> >
> >is there anyway of getting it to work with labels?
>
> No, no way.
>
> You missed out the Group By?
>
> select sum(a) as total, b
> from MYTABLE
> where b starting with 'whatever'
> group by b
> having sum(a) > 0
>
> /heLen