Received: from sam.on-net.net (sam.on-net.net [204.117.190.8]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBMJQqm94056 for ; Sat, 22 Dec 2001 14:26:52 -0500 (EST) (envelope-from fmorton@base2inc.com) Received: from edison (edison.base2inc.com [206.229.85.132]) by sam.on-net.net (8.11.3/8.11.6) with SMTP id fBMJQ7J16809 for ; Sat, 22 Dec 2001 14:26:07 -0500 (EST) Message-ID: <000d01c18b1e$9ba84320$8455e5ce@edison> From: "Frank Morton" To: References: Subject: JOIN question Date: Sat, 22 Dec 2001 14:26:50 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200112/241 X-Sequence-Number: 6063 I'm looking for the most portable way to do the following, given these two tables: Table 1 is called "content" which contains an integer "id" column. The value of this id is "1" for this example. Table 2 is called "protection" and keeps track of who can read and write the content object, so this table may contain multiple protection settings for a single content object. Simplifying, to consider my problem, the protection table contains a column called "contentId", connecting it to the content table id. This table has three rows in it for three groups that can read it with contentId set to "1". If I do the query: select Content.* from Content,Protection where (Content.id = Protection.contentId); I get three rows back, corresponding to each group that has access to the content. However, I would like to get back just one row, corresponding to the content that fits the desired protections. How do I do this? Thanks for answering this question for the relative sql newbie.