>I don't know how to do this with a subquery.
>
>If you don't mind separate queries - which is often faster, and more manageable, IMO - you might circumvent the GROUP BY problem as follows.
>
>
>select count(*) as HowMany;
> from Child;
> group by Master;
> into cursor Tmp;
> nofilter
>select ma.Field1, ma.Field2, ma.Field3, ..., nvl(ch.HowMany, 00000);
> from Master ma left join Child ch on ma.Master = ch.Master;
> group by ma.Master;
> into cursor Tmp
>
>
>Note that this (untested) example would also solve the problem of zero child records.
I need to do it in one query. Naomi provided the way to achieve it.