diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-01-22 06:27:41 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-01-22 06:27:41 +0000 |
commit | 505cdd5873aa101a58a80ee4bceb8000eb7f5a35 (patch) | |
tree | 4c93438976a353158d6dc354cb96e94200e21e8c /doc/FAQ | |
parent | 5f93794f1e046111f548ed9c6c75b891e8a0f7e0 (diff) | |
download | postgresql-505cdd5873aa101a58a80ee4bceb8000eb7f5a35.tar.gz postgresql-505cdd5873aa101a58a80ee4bceb8000eb7f5a35.zip |
Update FAQ.
Diffstat (limited to 'doc/FAQ')
-rw-r--r-- | doc/FAQ | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -948,15 +948,20 @@ SELECT * 4.24) How do I do an outer join? - PostgreSQL 7.1 and later supports outer joins. Here is an example: + PostgreSQL 7.1 and later supports outer joins. Here are two examples: + SELECT * + FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col); + + or SELECT * FROM t1 LEFT OUTER JOIN t2 USING (col); - This will join t1.col to t2.col, and return any unjoined rows in t1 - with NULL values for t2 columns. A RIGHT join would return unjoined - rows of table t2. A FULL join would return unjoined rows from t1 and - t2. The word OUTER is optional and is assumed in LEFT, RIGHT, and FULL - joins. Ordinary joins are called INNER joins. + These identical queries join t1.col to t2.col, and return any unjoined + rows in t1. A RIGHT join would return unjoined rows of table t2. A + FULL join would return unjoined rows from t1 and t2. The word OUTER is + optional and is assumed in LEFT, RIGHT, and FULL joins. Ordinary joins + are called INNER joins. + In previous releases, outer joins can be simulated using UNION and NOT IN. For example, when joining tab1 and tab2, the following query does an outer join of the two tables: |