Re: [GENERAL] Simulating an outer join
| От | Bruce Momjian |
|---|---|
| Тема | Re: [GENERAL] Simulating an outer join |
| Дата | |
| Msg-id | 200001122345.SAA20709@candle.pha.pa.us обсуждение исходный текст |
| Ответ на | Re: [GENERAL] Simulating an outer join (Julian Scarfe <jscarfe@callnetuk.com>) |
| Список | pgsql-general |
> > UNION ALL > > SELECT table1.key, NULL > > FROM table1 WHERE NOT EXISTS > > (SELECT table2.key FROM table2 WHERE table1.key = table2.key); > > FWIW, that's exactly Joe Celko's SQL-89 workaround for OUTER JOINs in 'SQL for > Smarties'. Well in fact he uses (SELECT * FROM table2 WHERE table1.key = > table2.key) as the subquery, but I presume that's an insignificant difference. I am just writing the EXISTS section from my book. I don't think it matters what fields are returned from an EXISTS subquery. If I am wrong, someone please let me know. -- 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 по дате отправления: