Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: The problem with FULL JOIN


  • From: Gregory Stark <stark(at)enterprisedb(dot)com>
  • To: <Eugen(dot)Konkov(at)aldec(dot)com>
  • Cc: <pgsql-bugs(at)postgresql(dot)org>
  • Subject: Re: The problem with FULL JOIN
  • Date: Sun, 30 Mar 2008 18:44:58 +0100
  • Message-id: <87r6ds3y3p(dot)fsf(at)oxford(dot)xeocode(dot)com>

<Eugen(dot)Konkov(at)aldec(dot)com> writes:

> PROBLEM:
> How to FULL JOIN groups=1 from table 'a' with groups=2 from table 'b' 
> and exclude original NULL groups not thouse which FULL JOIN produce?
...

SELECT *
FROM (select * from a where  a.groups = 1) AS a
FULL OUTER JOIN (select * from b where b.groups = 2) AS b
ON (a.num1=b.num1)

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's RemoteDBA services!



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group