pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Adam Sherman <adam@tritus.ca>
To: pgsql-sql@postgresql.org
Subject: Re: Locating all Children given Set of Parents
Date: Tue, 13 May 2003 12:01:45 -0700
Message-ID: <200305131201.45493.josh@agliodbs.com> (raw)
In-Reply-To: <194520000.1052848010@saturn>
References: <184690000.1052842782@saturn>
	<200305130947.46844.josh@agliodbs.com>
	<194520000.1052848010@saturn>

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




view thread (7+ messages)  latest in thread

Message-ID: <200305131201.45493.josh@agliodbs.com>
Permalink:  ../200305131201.45493.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200305131201.45493.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, adam@tritus.ca
  Subject: Re: Locating all Children given Set of Parents
  In-Reply-To: <200305131201.45493.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox