Skip to content

Commit 505cdd5

Browse files
committed
Update FAQ.
1 parent 5f93794 commit 505cdd5

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

doc/FAQ

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -948,15 +948,20 @@ SELECT *
948948

949949
4.24) How do I do an outer join?
950950

951-
PostgreSQL 7.1 and later supports outer joins. Here is an example:
951+
PostgreSQL 7.1 and later supports outer joins. Here are two examples:
952+
SELECT *
953+
FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);
954+
955+
or
952956
SELECT *
953957
FROM t1 LEFT OUTER JOIN t2 USING (col);
954958

955-
This will join t1.col to t2.col, and return any unjoined rows in t1
956-
with NULL values for t2 columns. A RIGHT join would return unjoined
957-
rows of table t2. A FULL join would return unjoined rows from t1 and
958-
t2. The word OUTER is optional and is assumed in LEFT, RIGHT, and FULL
959-
joins. Ordinary joins are called INNER joins.
959+
These identical queries join t1.col to t2.col, and return any unjoined
960+
rows in t1. A RIGHT join would return unjoined rows of table t2. A
961+
FULL join would return unjoined rows from t1 and t2. The word OUTER is
962+
optional and is assumed in LEFT, RIGHT, and FULL joins. Ordinary joins
963+
are called INNER joins.
964+
960965
In previous releases, outer joins can be simulated using UNION and NOT
961966
IN. For example, when joining tab1 and tab2, the following query does
962967
an outer join of the two tables:

doc/src/FAQ/FAQ.html

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,21 +1224,26 @@ <H4><A name="4.23">4.23</A>) Why are my subqueries using
12241224
<H4><A name="4.24">4.24</A>) How do I do an <I>outer</I> join?<BR>
12251225
</H4>
12261226

1227-
<P>PostgreSQL 7.1 and later supports outer joins. Here is an
1228-
example:</P>
1227+
<P>PostgreSQL 7.1 and later supports outer joins. Here are two
1228+
examples:</P>
1229+
<PRE>
1230+
SELECT *
1231+
FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);
1232+
</PRE>
1233+
or
12291234
<PRE>
12301235
SELECT *
12311236
FROM t1 LEFT OUTER JOIN t2 USING (col);
12321237
</PRE>
1233-
This will join t1.col to t2.col, and return any unjoined rows in t1
1234-
with <SMALL>NULL</SMALL> values for t2 columns. A
1235-
<SMALL>RIGHT</SMALL> join would return unjoined rows of table t2. A
1236-
<SMALL>FULL</SMALL> join would return unjoined rows from t1 and t2.
1237-
The word <SMALL>OUTER</SMALL> is optional and is assumed in
1238-
<SMALL>LEFT</SMALL>, <SMALL>RIGHT</SMALL>, and <SMALL>FULL</SMALL>
1239-
joins. Ordinary joins are called <SMALL>INNER</SMALL> joins.<BR>
1240-
<BR>
1241-
In previous releases, outer joins can be simulated using
1238+
These identical queries join t1.col to t2.col, and return any
1239+
unjoined rows in t1. A <SMALL>RIGHT</SMALL> join would return
1240+
unjoined rows of table t2. A <SMALL>FULL</SMALL> join would return
1241+
unjoined rows from t1 and t2. The word <SMALL>OUTER</SMALL> is
1242+
optional and is assumed in <SMALL>LEFT</SMALL>,
1243+
<SMALL>RIGHT</SMALL>, and <SMALL>FULL</SMALL> joins. Ordinary joins
1244+
are called <SMALL>INNER</SMALL> joins.</P>
1245+
1246+
<P>In previous releases, outer joins can be simulated using
12421247
<SMALL>UNION</SMALL> and <SMALL>NOT IN</SMALL>. For example, when
12431248
joining <I>tab1</I> and <I>tab2,</I> the following query does an
12441249
<I>outer</I> join of the two tables:<BR>

0 commit comments

Comments
 (0)