Subject Re: [firebird-support] Sum results of a subquery?
Author Kjell Rilbe
Alan McDonald wrote:
>>select sum("DuplicatesPerCategory") "Duplicates"
>>from (
>> select count(*) - 1 "DuplicatesPerCategory"
>> from "TheTable"
>> group by "Category"
>> having count(*) > 1
>>)
>>
> create a view with your subselect, then select over it with the count(*)

Ok then I think I'll settle for the loop. :-) But thanks anyway - it's
nice to know what my options are.

> BTW - do you really need the mixed case object identifiers? what a pain

Nope, don't need'em. Want'em! :-) I like readability. On the other hand,
the names up there were made up to make my question clear - they're not
the names I actually use.

Many thanks,
Kjell
--
--------------------------------------
Kjell Rilbe
Adressmarknaden AM AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64