Re: Repost: Syntax - or unavailability of same - for variable join??? Can anyone help?

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Mike Nolan
Дата:
Сообщение: CRM Academic Research Request
Следующее
От: pativo@arcor.de (pativo)
Дата:
Сообщение: String manipulation