Re: Repost: Syntax - or unavailability of same - for variable join??? Can anyone help?
В списке pgsql-general по дате отправления:
| От | Greg Patnude |
|---|---|
| Тема | Re: Repost: Syntax - or unavailability of same - for variable join??? Can anyone help? |
| Дата | |
| Msg-id | c0sasp$1m0d$1@news.hub.org обсуждение исходный текст |
| Список | pgsql-general |
You might have better success with the form of HAVING and appropriate use of OR IS NULL as opposed to strict JOIN and WHERE conditions... Similar to... SELECT A.a, B.b, C.c FROM A, B, C HAVING (A.b = B.b OR B.b IS NULL) GROUP BY A.b; -- Greg Patnude / The Digital Demention 2916 East Upper Hayden Lake Road Hayden Lake, ID 83835 (208) 762-0762 "Ben" <reply@to-the-newsgroup.com> wrote in message news:4c4c5dc750469f3b777c4f42ba9c0505@news.teranews.com... > I want to say: > > SELECT tableA.stuff,tableB.morestuff,tableC.stillmorestuff > FROM tableA, > LEFT OUTER JOIN tableB ON (AB match conditions) > LEFT OUTER JOIN tableC ON (AC match conditions) > WHERE etc > > However, in some cases, tableB does not have rows where the other two do > (it contains credit card records... but when an order is paid by check, there is > no record.) > > What happens with the above syntax is I don't get a row at all. > > Is there a way to say that if tableB has no row, I get blank columns? > > Maybe I'm just looking at the wrong, but I can't seem to find out how, or > if, one can do this. > > Thanks for any input. > > --Ben > >
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера