Subject Re: [firebird-support] Help with query
Author Lucas Franzen

how about writing a stored procedure that will fulfill both of your
requirements in one go?

But if your Integer field in the table is used for storing some kind of
count information then restructre your table to some kind of
master-detail which can do your counting "on the fly" by just one SELECT
- GROUP BY statement.