File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 102102 Why?
103103 4.22) How do I create a column that will default to the current time?
104104 4.23) Why are my subqueries using IN so slow?
105+ 4.24) How do I do an outer join?
105106
106107 Extending PostgreSQL
107108
@@ -992,6 +993,21 @@ BYTEA bytea variable-length array of bytes
992993 WHERE EXISTS (SELECT col2 FROM TAB2 WHERE col1 = col2)
993994
994995 We hope to fix this limitation in a future release.
996+
997+ 4.24) How do I do an outer join?
998+
999+ PostgreSQL does not support outer joins in the current release. They
1000+ can be simulated using UNION and NOT IN. For example, when joining
1001+ tab1 and tab2, the following query does an outer join of the two
1002+ tables:
1003+ SELECT tab1.col1, tab2.col2
1004+ FROM tab1, tab2
1005+ WHERE tab1.col1 = tab2.col1
1006+ UNION ALL
1007+ SELECT tab1.col1, NULL
1008+ FROM tab1
1009+ WHERE tab1.col1 NOT IN (SELECT tab2.col1 FROM tab2)
1010+ ORDER BY tab1.col1
9951011 _________________________________________________________________
9961012
9971013 Extending PostgreSQL
You can’t perform that action at this time.
0 commit comments