pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
newbie outer-join
2+ messages / 2 participants
[nested] [flat]

* newbie outer-join
@ 1999-11-08 20:06  Matlack, Brad <matlackb@ogden.disa.mil>
  0 siblings, 1 reply; 2+ messages in thread

From: Matlack, Brad @ 1999-11-08 20:06 UTC (permalink / raw)
  To: pgsql-sql

I'm trying to do what I think is an outer-join:

SELECT 
 da.datname as database,
 de.description as comment
FROM 
 pg_database as da,
 pg_description as de
WHERE 
(da.oid = de.objoid)

Obviously, if there are no descriptions, no values will be returned.
What I want is to display all databases, with comments (valid or null).

How do I form the WHERE clause?
Thanks,
Brad Matlack
matlackb@ogden.disa.mil





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] newbie outer-join
@ 1999-11-08 21:26  Peter Eisentraut <peter_e@gmx.net>
  parent: Matlack, Brad <matlackb@ogden.disa.mil>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 1999-11-08 21:26 UTC (permalink / raw)
  To: Matlack, Brad <matlackb@ogden.disa.mil>; +Cc: pgsql-sql

On 1999-11-08, Matlack, Brad mentioned:

> I'm trying to do what I think is an outer-join:
> 
> SELECT 
>  da.datname as database,
>  de.description as comment
> FROM 
>  pg_database as da,
>  pg_description as de
> WHERE 
> (da.oid = de.objoid)
> 
> Obviously, if there are no descriptions, no values will be returned.
> What I want is to display all databases, with comments (valid or null).

SELECT datname, [...,] obj_description(pg_database.oid) FROM pg_database;

is a work-around. Outer joins will appear in the next release, so I hear.


-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-11-08 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-11-08 20:06 newbie outer-join Matlack, Brad <matlackb@ogden.disa.mil>
1999-11-08 21:26 ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox