@@ -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 >