| От | Tom Lane |
|---|---|
| Тема | Re: Joining on a column that might be null |
| Дата | |
| Msg-id | 16739.983332850@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Joining on a column that might be null ("James McMurry" <jmcmurry@pobox.com>) |
| Список | pgsql-novice |
"James McMurry" <jmcmurry@pobox.com> writes: > item.created_by contains entries from member.member_id, and I'd like to > select records from item with the full member_name: > select a.item_id, a.item_name, b.member_name > from item a, member b > where a.created_by = b.member_id > The problem I'm having is that created_by can be null. The above statement > won't give me results for those records. I believe what you're looking for is an "outer join". We have this for real in PG 7.1, but in earlier releases you have to fake it with a UNION construct. See http://www.postgresql.org/docs/faq-english.html#4.24 regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера