Re: stupid SQL question, how reach different rows of two almost same tables

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Jaromír Kamler <kamler(at)centrum(dot)cz>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: stupid SQL question, how reach different rows of two almost same tables
Date: 2005-10-04 21:51:34
Message-ID: c2d9e70e0510041451o6217f9d0n7f436dd1303f55eb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 10/4/05, Jaromír Kamler <kamler(at)centrum(dot)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 ;)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-10-05 00:04:47 Re: Sorting by the maximum value of two columns
Previous Message Jaromír Kamler 2005-10-04 21:06:36 stupid SQL question, how reach different rows of two almost same tables