From: | Algirdas Šakmanas <asakmanas(at)grafton(dot)lt> |
---|---|
To: | <pgsql-sql(at)postgresql(dot)org> |
Subject: | outer joins |
Date: | 2001-04-04 11:03:11 |
Message-ID: | NFBBJHKIMLJDMKFOHEPEEECFCAAA.asakmanas@grafton.lt |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi all,
I'm new to postgre, I've changed my work and consequently now i'm moving
from MS plaform.
In MS SQL there are such constructs left or right outer join, in postgres
there are no such thing
Can You offer me strategy to make query that selects from table (a) and
joins to it another (b)
on e.g. a.id=b.aid but joins so that in case there is no value in table b
NULL is left in result:
in MS SQL i've used query:
select a.id, b.name from a left outer join b on a.id=b.aid
table a table b
id | aid | name
----------- ----------------
1 1 | Tom
2 3 | Sam
result:
a.id | b.name
---------------------
1 | Tom
2 | NULL
thank you in advance
Algirdas Šakmanas
IT manager
+370 99 90369
asakmanas(at)grafton(dot)lt
Grafton Entertainment
http://www.tvnet.lt
From | Date | Subject | |
---|---|---|---|
Next Message | Albert REINER | 2001-04-04 11:04:23 | Historical dates in Timestamp |
Previous Message | Koen Antonissen | 2001-04-04 11:01:57 | restoring indices |