X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C6B4DD1B4E5 for ; Thu, 23 Oct 2003 18:34:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 07587-04 for ; Thu, 23 Oct 2003 15:33:32 -0300 (ADT) Received: from imo-d02.mx.aol.com (imo-d02.mx.aol.com [205.188.157.34]) by svr1.postgresql.org (Postfix) with ESMTP id 9F2FBD1B522 for ; Thu, 23 Oct 2003 15:33:29 -0300 (ADT) Received: from yusuf0478@netscape.net by imo-d02.mx.aol.com (mail_out_v36_r1.1.) id k.1a.b04520a (16215) for ; Thu, 23 Oct 2003 14:33:10 -0400 (EDT) Received: from netscape.net (mow-m15.webmail.aol.com [64.12.180.131]) by air-in01.mx.aol.com (v96.8) with ESMTP id MAILININ13-3f573f981eb4211; Thu, 23 Oct 2003 14:32:20 -0400 Date: Thu, 23 Oct 2003 14:33:09 -0400 From: yusuf0478@netscape.net To: pgsql-sql@postgresql.org Subject: Query Help MIME-Version: 1.0 Message-ID: <7E2F242E.303998B7.037EC703@netscape.net> X-Mailer: Atlas Mailer 2.0 X-AOL-IP: 66.163.11.108 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.7 tagged_above=0.0 required=5.0 tests=FREE_TRIAL, FROM_ENDS_IN_NUMS, NO_REAL_NAME X-Spam-Level: * X-Archive-Number: 200310/310 X-Sequence-Number: 15710 I'm interested in finding the minimim A.id such that the following holds: select A.charge , B.user_id , C.employee_id from A inner join B using (user_id) inner join C using (employee_id) except select X.charge , Y.user_id , Z.employee_id from X inner join Y using (user_id) inner join Z using (employee_id) -- I can't do the following, since the number of selected columns have to match: select A.id , A.charge , B.user_id , C.employee_id from A inner join B using (user_id) inner join C using (employee_id) except select X.charge , Y.user_id , Z.employee_id from X inner join Y using (user_id) inner join Z using (employee_id) Can someone help me with the query? Thanks in advance. __________________________________________________________________ McAfee VirusScan Online from the Netscape Network. Comprehensive protection for your entire computer. Get your free trial today! http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397 Get AOL Instant Messenger 5.1 free of charge. Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455