Re: Locating all Children given Set of Parents

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Adam Sherman <adam(at)tritus(dot)ca>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Locating all Children given Set of Parents
Date: 2003-05-13 19:01:45
Message-ID: 200305131201.45493.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Adam,

> > Select children.*
> > from children where exists (select pc_id
> > from parent_child
> > where pc.child_id = children.id
> > and pc.parent_id IN ($parent_id_list)
> > );
>
> What is "pc_id" referring too?

parent_child.id

Which column you use isn't important, just don't use "SELECT *"

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Adam Sherman 2003-05-13 19:19:03 Re: Locating all Children given Set of Parents
Previous Message Adam Sherman 2003-05-13 17:50:43 Re: Locating all Children given Set of Parents