set difference

From: Domoszlai László <dlacko(at)finit(dot)hu>
To: "SQL PostgreSQL (E-mail)" <pgsql-sql(at)postgresql(dot)org>
Subject: set difference
Date: 2002-10-15 12:52:23
Message-ID: D6CD29CE4DF67F47A11FB6CF5EBE15D10ECC55@gedeon.finit.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

I would like to make symmetrical(set) difference in a query.
But the simpliest way I could find is

select id from a
except
select id from b
union
select id from b
except
select id from a

Is there any better solution for this problem?

Thanks
Laca

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-10-15 13:57:59 Re: Stored procedure returning row or resultset
Previous Message wishy wishy 2002-10-15 11:46:37 Re: foreign keys again