Re: Locating all Children given Set of Parents - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Locating all Children given Set of Parents
Date
Msg-id 200305131201.45493.josh@agliodbs.com
Whole thread Raw
In response to Re: Locating all Children given Set of Parents  (Adam Sherman <adam@tritus.ca>)
Responses Re: Locating all Children given Set of Parents  (Adam Sherman <adam@tritus.ca>)
List 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 BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: Adam Sherman
Date:
Subject: Re: Locating all Children given Set of Parents
Next
From: Adam Sherman
Date:
Subject: Re: Locating all Children given Set of Parents