Subject | Re: [ib-support] Re: generator of generators |
---|---|
Author | Lucas Franzen |
Post date | 2003-03-02T10:41:36Z |
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...)
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.
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 recordsTo getthe number of records fopr each company you can use sth. like:
> inserted for a company, you'll getthe number of "tried" (and maybe
> cancelled or later deleted) inserts plus 1 for the company.
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.