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 8C47FD1E2D7 for ; Tue, 23 Mar 2004 20:02:36 +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 53056-08 for ; Tue, 23 Mar 2004 16:02:34 -0400 (AST) Received: from mta04-svc.ntlworld.com (mta04-svc.ntlworld.com [62.253.162.44]) by svr1.postgresql.org (Postfix) with ESMTP id EF1C9D1D9C2 for ; Tue, 23 Mar 2004 16:02:31 -0400 (AST) Received: from [81.98.165.129] by mta04-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20040323200213.GEYR4168.mta04-svc.ntlworld.com@[81.98.165.129]> for ; Tue, 23 Mar 2004 20:02:13 +0000 Mime-Version: 1.0 (Apple Message framework v613) To: pgsql-sql@postgresql.org Message-Id: <051D7AFC-7D05-11D8-AC21-0003938366A4@ntlworld.com> Content-Type: multipart/alternative; boundary=Apple-Mail-1-833220746 From: beyaNet Consultancy Subject: SQL Query Date: Tue, 23 Mar 2004 20:02:32 +0000 X-Mailer: Apple Mail (2.613) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/239 X-Sequence-Number: 17338 --Apple-Mail-1-833220746 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hi, I am trying to create a query which basically goes along the lines of: INSERT INTO tableX ( COL1, COL2 ) VALUES ( x, y ) where COL1 !=x and COL2 !=Y So, insert a record into tableX where there is not already an existence of COL1 and COL2 Can this be done as I have described or is there a more efficient way to do this? many thanks Peter --Apple-Mail-1-833220746 Content-Transfer-Encoding: 7bit Content-Type: text/enriched; charset=US-ASCII Hi, I am trying to create a query which basically goes along the lines of: CourierINSERT INTO tableX ( COL1, COL2 ) VALUES ( x, y ) where COL1 !=x and COL2 !=Y So, insert a record into tableX where there is not already an existence of COL1 and COL2 Can this be done as I have described or is there a more efficient way to do this? many thanks Peter --Apple-Mail-1-833220746--