X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id D3DA7CCA46 for ; Thu, 17 Jul 2003 15:10:16 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 44772-07 for ; Thu, 17 Jul 2003 15:10:36 +0000 (GMT) Received: from lawnmarket.ucs.ed.ac.uk (lawnmarket.ucs.ed.ac.uk [129.215.166.63]) by svr1.postgresql.org (Postfix) with ESMTP id 14A23CAE14 for ; Thu, 17 Jul 2003 12:10:05 -0300 (ADT) Received: from LIBPC1118 (library-mg-01.net.ed.ac.uk [129.215.146.81]) by lawnmarket.ucs.ed.ac.uk (8.11.6p2/8.11.6) with SMTP id h6HFAWJ23841; Thu, 17 Jul 2003 16:10:32 +0100 (BST) Message-ID: <00db01c34c75$754a6400$5192d781@lib.ed.ac.uk> Reply-To: "Richard Jones" From: "Richard Jones" To: "Viorel Dragomir" , , , References: <009f01c34c6f$ca98d3c0$5192d781@lib.ed.ac.uk> <01d401c34c70$97983a50$0600a8c0@fix.ro> Subject: Re: NOT and AND problem Date: Thu, 17 Jul 2003 16:09:45 +0100 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 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=REFERENCES X-Spam-Level: X-Archive-Number: 200307/226 X-Sequence-Number: 14340 Hello, Just to say thanks for such fast responses. The full working query is indeed as suggested (I cut the demo query down when I posted it, as it's got some awfully long names in it in real life): DELETE FROM eulepersongroup2workspaceitem WHERE NOT EXISTS ( SELECT 1 FROM workspaceitem WHERE workspace_item_id = eulepersongroup2workspaceitem.workspace_item_id ) OR NOT EXISTS ( SELECT 1 FROM epersongroup WHERE eperson_group_id = eulepersongroup2workspaceitem.eperson_group_id ); Thanks very much for your help. Regards Richard Richard Jones ----------------------- Systems Developer Theses Alive! - www.thesesalive.ac.uk Edinburgh University Library r.d.jones@ed.ac.uk 0131 651 1611