Simulating an outer join - Mailing list pgsql-general

From Bruce Momjian
Subject Simulating an outer join
Date
Msg-id 200001121611.LAA03508@candle.pha.pa.us
Whole thread Raw
List pgsql-general
I have been thinking about how to simulate an outer join.  It seems the
best way is to do:

    SELECT tab1.col1, tab2.col3
    FROM tab1, tab2
    WHERE tab1.col1 = tab2.col2
    UNION ALL
    SELECT tab1.col1, NULL
    FROM tab1
    WHERE tab1.col1 NOT IN (SELECT tab2.col2 FROM tab2)

Comments?  I know someone was asking about this recently.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: "Robert Wagner"
Date:
Subject: identifying performance hits: how to ???
Next
From: Karl DeBisschop
Date:
Subject: Re: [GENERAL] identifying performance hits: how to ???