From: | Sam Mason <sam(at)samason(dot)me(dot)uk> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: |
Date: | 2009-06-30 20:37:11 |
Message-ID: | 20090630203711.GP5407@samason.me.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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/
From | Date | Subject | |
---|---|---|---|
Next Message | johnf | 2009-06-30 23:22:10 | Re: BETWEEN not matching on timestamp value |
Previous Message | Erik Jones | 2009-06-30 20:28:43 | Re: |