Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Counting foreign keys
>
> TABLEA
> (
> pk
> )
>
> TABLEB
> (
> pk2
> fk REFERENCES TABLEA(pk)
> )
select tablea.pk, count(tableb.pk2)
from tablea, tableb where tablea.pk = tableb.pk (+) group by tablea.pk;
-- Regards Sergey Gerasimov gsa_at_baltros.ruReceived on Fri Dec 29 2000 - 03:02:34 CST