- Mailing list pgsql-general

From Joost Kraaijeveld
Subject
Date
Msg-id A3D1526C98B7C1409A687E0943EAC41001EB1E@obelix.askesis.nl
Whole thread Raw
Responses Re:
List pgsql-general
Hi all,

Is it possible to count and display the number of children of a parent in a generic query?


parent table: id
child table: id, parent_id

Example output of the query:

parentid    number_of_children
parent1     2
parent2     6
parent3     0



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: "Vincent Hikida"
Date:
Subject: Re: Question on a select
Next
From: Pierre-Frédéric Caillaud
Date:
Subject: Re: many similar indexbased selects are extremely slow