X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D630D47636B for ; Tue, 13 May 2003 12:25:17 -0400 (EDT) Received: from secure.tritus.ca (baxter.tritus.ca [209.47.166.15]) by postgresql.org (Postfix) with ESMTP id BEDAF474E42 for ; Tue, 13 May 2003 12:25:13 -0400 (EDT) Received: from [10.200.200.129] (CPE00045ae165bc-CM014320108734.cpe.net.cable.rogers.com [::ffff:24.157.7.10]) (AUTH: CRAM-MD5 adam@tritus.ca, TLS: TLSv1/SSLv3, 168bits, DES-CBC3-SHA) by secure.tritus.ca with esmtp; Tue, 13 May 2003 12:25:12 -0400 Date: Tue, 13 May 2003 12:19:42 -0400 From: Adam Sherman To: pgsql-sql@postgresql.org Subject: Locating all Children given Set of Parents Message-ID: <184690000.1052842782@saturn> X-Mailer: Mulberry/3.0.3 (Linux/x86) X-OpenPGP: 82C7 7288 650F 8F77 2FFB C170 3698 125A 79C3 FC80 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam-Status: No, hits=-5.8 required=5.0 tests=BAYES_10 version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/228 X-Sequence-Number: 13393 I have three tables: parents, children & parent_child_mm. (So Parents and Children are in a Many-to-Many relationship.) Given a set of Parents, say 1, 2 & 3, how do I retrieve all children in an efficient manner? (I want each child to appear only once.) Thanks, A. -- Adam Sherman Tritus CG Inc. http://www.tritus.ca/ +1 (613) 797-6819