Re: Finding missing records

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Finding missing records
Date: 2006-01-27 14:03:42
Message-ID: 20060127140342.GA8465@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am 27.01.2006, um 14:59:47 +0100 mailte Stefano B. folgendes:
> How can I find the difference between the two tables?
> table1 has 10000 records
> table2 has 9900 records (these records are in table1 as well)
>
> I'd like to find 100 missing records.
> I have try this query
>
> select f1,f2,f3,f4 from table1 where (f1,f2,f3,f4) NOT IN (select f1,f2,f3,f4 from table2)

select f1,f2,f3,f4 from table1 except select f1,f2,f3,f4 from table2;

HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47215, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pandurangan R S 2006-01-27 14:03:59 Re: Finding missing records
Previous Message Stefano B. 2006-01-27 13:59:47 Finding missing records