Subject Re: [ib-support] Re: generator of generators
Author Lucas Franzen
oups.

Sent to eartly (while hacking on my keyboard I must have hit a shortcut
for sending even though I don't know which one it was...)

> No. With Gen_id (generator_N, 1) you won't get the number of records
> inserted for a company, you'll getthe number of "tried" (and maybe
> cancelled or later deleted) inserts plus 1 for the company.

To getthe number of records fopr each company you can use sth. like:
SELECT COMPANY_NO, COUNT (*) AS REC_FOR_COMPANY
FROM TABLE
GROUP BY COMPANY_NO

and you'll get an overview like:
COMPANY_NO REC_FOR_COMPANY
1 123
2 4366
3 629
etc.

For one company you can do a SELECT COUNT(*) from TABLE WHERE COMPANY_NO
= :NO

Luc.