Received: from connectnet2.connectnet.com (spool.connectnet.com [207.110.0.12]) by hub.org (8.9.3/8.9.3) with ESMTP id UAA87654 for ; Sun, 19 Dec 1999 20:47:00 -0500 (EST) (envelope-from bbaldwin@indyme.com) Received: from INDYMEEXCH.INDY.COM (indymemail.indyme.com [207.110.14.226]) by connectnet2.connectnet.com (8.9.1/CONNECTnet-4.0/THROTTLE) with ESMTP id RAA20098 for ; Sun, 19 Dec 1999 17:46:58 -0800 (PST) Received: by INDYMEEXCH with Internet Mail Service (5.5.2650.21) id ; Sun, 19 Dec 1999 17:47:08 -0800 Message-ID: <319A9588FB5ED2119FAC00A0C912E3292785C0@INDYMEEXCH> From: Barry Baldwin To: PGSQL-SQL Subject: MINUS emulation? Date: Sun, 19 Dec 1999 17:47:06 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Hi all, I'm trying to do a query that returns all the records in one table unless they exist in another table. For example the first query I tried was this; Select A.field_id, A.data, B.field_id, B.data from table_1 A, table_2 B where A.field_id <> B.field_id; This query resulted in no records being returned, I believe this is because Table_2 is empty. I then tried : Select field_id, data from table_1 minus Select field_id, data from table_2; This didn't work because the Minus directive isn't recognized. Does anyone have a suggestion on how I might accomplish this? TIA, Barry