Re: compare 2 tables in sql - Mailing list pgsql-sql

From Dean Gibson (DB Administrator)
Subject Re: compare 2 tables in sql
Date
Msg-id 47E18CFF.2020408@ultimeth.com
Whole thread Raw
In response to compare 2 tables in sql  ("Tena Sakai" <tsakai@gallo.ucsf.edu>)
List pgsql-sql
On 2008-03-19 10:56, Tena Sakai wrote: <blockquote
cite="mid:FE44E0D7EAD2ED4BB2165071DB8E328C0378F138@egcrc-ex01.egcrc.org"type="cite"></blockquote><p><font size="2">Hi
Everybody,<br/><br /> Is there a sql way to compare (in a diff/cmp sense) 2 tables?  For example,<br /><br />   create
tablefoo as<br />   [select bla bla bla];<br /><br />   create table moo as<br />   [select bla bla bla];<br /><br />
Howwould I go about knowing foo and moo are identical (or not)?  Any pointer would be appreciated.<br /><br /> Tena<br
/></font> You could do a full outer join of "foo" and "moo" on whatever is the common key, and then delete those rows
whichdon't have null fields in the either the left or right sides;  the remainder would be the differences.<br /><pre
class="moz-signature"cols="72">-- 
 
Mail to my list address MUST be sent via the mailing list.
All other mail to my list address will bounce.</pre>

pgsql-sql by date:

Previous
From: Volkan YAZICI
Date:
Subject: Re: compare 2 tables in sql
Next
From: Christopher Crews
Date:
Subject: Date and filling issues