Thread: PostgreSQL Outer Joins
Does PostgreSQL 7.1.3 support outer joins; or do you still need to use subqueries?
If it does support outer joins, does anyone know the syntax?
If it does not, does anyone know when it might?
Thank you for your time!
Troy Campano
Outer joins are supported. Look here for the syntax: http://www.postgresql.org/idocs/index.php?sql-language.html I believe the syntax is just standard SQL. (The (+) shorthand that Oracle uses is not supported.) -Nick -------------------------------------------------------------------------- Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788 Ray Ontko & Co. Software Consulting Services http://www.ontko.com/ -----Original Message----- From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Campano, Troy Sent: Monday, December 10, 2001 1:25 PM To: Pgsql-General (pgsql-general@postgresql.org) Subject: [GENERAL] PostgreSQL Outer Joins Does PostgreSQL 7.1.3 support outer joins; or do you still need to use subqueries? If it does support outer joins, does anyone know the syntax? If it does not, does anyone know when it might? Thank you for your time! Troy Campano
PostgreSQL Outer Joins> Does PostgreSQL 7.1.3 support outer joins; or do you still need to use subqueries? Yes, outer joins are supported. > If it does support outer joins, does anyone know the syntax? ANSI SQL. Example: SELECT * FROM T1 LEFT JOIN T2 ON T1.ID=T2.ID; Greg
Full support for outer joins, see: http://www.postgresql.org/idocs/index.php?queries.html Bob On Monday 10 December 2001 01:24 pm, Campano, Troy wrote: > Does PostgreSQL 7.1.3 support outer joins; or do you still need to use > subqueries? > > > If it does support outer joins, does anyone know the syntax? > > If it does not, does anyone know when it might? > > > > Thank you for your time! > > > Troy Campano
Yes, outer joins are supported as of 7.1. The basic syntax is: SELECT field1, field2 FROM t1 LEFT OUTER JOIN t2 ON t1.id = t2.id You can use LEFT OUTER JOIN, RIGHT OUTER JOIN, or FULL OUTER JOIN. See the docs for details at http://www.postgresql.org/idocs/index.php?sql-select.html. --Wes Sheldahl "Campano, Troy" <Troy.Campano%LibertyMutual.com@interlock.lexmark.com> on 12/10/2001 01:24:41 PM To: "Pgsql-General (pgsql-general@postgresql.org)" <pgsql-general%postgresql.org@interlock.lexmark.com> cc: (bcc: Wesley Sheldahl/Lex/Lexmark) Subject: [GENERAL] PostgreSQL Outer Joins Does PostgreSQL 7.1.3 support outer joins; or do you still need to use subqueries? If it does support outer joins, does anyone know the syntax? If it does not, does anyone know when it might? Thank you for your time! Troy Campano
"Campano, Troy" <Troy.Campano@LibertyMutual.com> writes: > Does PostgreSQL 7.1.3 support outer joins; or do you still need to use > subqueries? Yes, it supports outer joins. > If it does support outer joins, does anyone know the syntax? Same syntax as the SQL standard I think (as opposed to Oracle's which is nonstandard). See the docs: http://www.us.postgresql.org/users-lounge/docs/#7.1 -Doug -- Let us cross over the river, and rest under the shade of the trees. --T. J. Jackson, 1863