Re: stupid SQL question, how reach different rows of two almost same tables - Mailing list pgsql-novice

From Jaime Casanova
Subject Re: stupid SQL question, how reach different rows of two almost same tables
Date
Msg-id c2d9e70e0510041451o6217f9d0n7f436dd1303f55eb@mail.gmail.com
Whole thread Raw
In response to stupid SQL question, how reach different rows of two almost same tables  (" Jaromír Kamler" <kamler@centrum.cz>)
List pgsql-novice
On 10/4/05, Jaromír Kamler <kamler@centrum.cz> wrote:
> I am sorry, I know that this is an SQL problem ... . I need reach different
> rows in 2 almost same tables. I need use it in PL/pgSQL. Thanks for your
> advidce.
>
>

this works?...

create temp table t1 as
select * from (select * from foo1 intersect select * from foo2) as tmp_foo;

select * from (select * from foo1 except select * from t1) as tmp_foo1
union
select * from (select * from foo2 except select * from t1) as tmp_foo2;


--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

pgsql-novice by date:

Previous
From: David Gaudine
Date:
Subject: Sorting by the maximum value of two columns
Next
From: "Alvaro Cobo"
Date:
Subject: Moving from MySQL