[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL]
From:       Sam Mason <sam () samason ! me ! uk>
Date:       2009-06-30 20:37:11
Message-ID: 20090630203711.GP5407 () samason ! me ! uk
[Download RAW message or body]

On Tue, Jun 30, 2009 at 01:14:10PM +0200, Waldemar Bergstreiser wrote:
> I found a good explanation about informix outer joins. 
> 
> http://savage.net.au/SQL/outer-joins.html
> 
> Please take a look at that.

The syntax appears to make the expression of various idioms difficult;
for example, how would I express the following:

  SELECT *
  FROM a LEFT JOIN b ON a.id = b.id
  WHERE b.id IS NULL OR a.c <> b.d;

Admittedly I don't write code like this very often but, yes, I have used
it on some occasions.  I guess I'd have to resort to a subselect?


I believe this is what Tom was referring to when he said that "there's
no principled way to decide what it *means*".  For example the semantics
of the above are very different from either of:

  SELECT *
  FROM a LEFT JOIN b ON a.id = b.id OR a.c <> b.d
  WHERE b.id IS NULL;

or:

  SELECT *
  FROM a LEFT JOIN b ON a.id = b.id AND (b.id IS NULL OR a.c <> b.d)

and I can't think of any other formulations after reading the link you
gave---it only seems to talk about binary operators involving columns
from two tables.  Second shouldn't be allowed, but I included it in case
I was missing something.

-- 
  Sam  http://samason.me.uk/

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic