Re: Select number of children of a parent query - Mailing list pgsql-general

From Joost Kraaijeveld
Subject Re: Select number of children of a parent query
Date
Msg-id A3D1526C98B7C1409A687E0943EAC41001EB1F@obelix.askesis.nl
Whole thread Raw
Responses Re: Select number of children of a parent query
List pgsql-general
Hi John,

John Sidney-Woollett schreef:
> Useful to add a title to your messages before you post...
It escaped before finishing.....

> How about:
>
> select parentid, count(*) as number_of_children
> from childtable
> group by parentid
> order by parentid;
It works but can you tell me why this works? Is the count(*) over the "group by parentid"?


Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: OS X shared memory problems 8.0rc3
Next
From: David Fetter
Date:
Subject: Re: Function Parameters