Received: from exchange.bilgi.edu.tr (prol800.ibun.edu.tr [194.27.149.22]) by hub.org (8.10.1/8.10.1) with ESMTP id e6B0rDW99793 for ; Mon, 10 Jul 2000 20:53:13 -0400 (EDT) Received: from bilgi.edu.tr (194.27.149.10 [194.27.149.10]) by exchange.bilgi.edu.tr with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id MMKH80G5; Tue, 11 Jul 2000 03:47:45 +0300 Message-ID: <396A6F59.6132C357@bilgi.edu.tr> Date: Tue, 11 Jul 2000 03:50:33 +0300 From: Erol Oz X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: "Zot O'Connor" CC: postgres sql Subject: Re: Finding entries not in table..differnce? References: <396A6A7B.39CC7772@zotconsulting.com> Content-Type: text/plain; charset=iso-8859-9 Content-Transfer-Encoding: 7bit X-Archive-Number: 200007/114 If I understand you exactly, you may use except: select distinct * from prodlang except select distinct * from prodlang2 gives you the records which exist in prodlang and do not exist in prodlang2. So you get all the records in prodlang which are newly inserted or updated. regards erol Zot O'Connor wrote: > > I need to write a quick function that tells me all of the entriles in > table that are not in table2. > > The tables are copies of each other, but 1 has been updated. I know > this is easy, but I am running on little sleep :) > > I want to due something like > > select prodlang.prodlsku from prodland,prodlang2 WHERE prodlang.prodlsku > != prodlang2.prodlsku > > But of course I would get every record, several times since at some > point the sku does not equal another sku. > > I tried !!= (NOT IN) but it did not like that at all, since sku is a > char field. > > I am running an older version of postgress on this server, I do not know > if that is important. > > -- > Zot O'Connor > > http://www.ZotConsulting.com > http://www.WhiteKnightHackers.com