Count the children

From: Michael Rowan <mike(dot)rowan(at)internode(dot)on(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Count the children
Date: 2009-08-18 14:34:13
Message-ID: 4BB75B17-3932-4B44-8D82-CF7C07CDFE09@internode.on.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I need what sounds like a very simple query - but I'm darned if I can
figure it out.

I have two tables, parent and child related by child.parent_id =
parent.id
The query should return, for each parent row, parent.name and number
of child rows

Can someone enlighten me, please?

Michael Rowan
mike(dot)rowan(at)internode(dot)on(dot)net

11 Kingscote Street
ALBERTON
South Australia 5014

tel 618 8240 3993

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mark Styles 2009-08-18 14:44:00 Re: Count the children
Previous Message Michael Gould 2009-08-18 14:19:18 Platform for running Postgres 8.4