Re: A JOIN question

Поиск
Список
Период
Сортировка
От stan
Тема Re: A JOIN question
Дата
Msg-id 20191230221323.GA2064@panix.com
обсуждение исходный текст
Ответ на Re: A JOIN question  (Michael Lewis <mlewis@entrata.com>)
Список pgsql-general
On Mon, Dec 30, 2019 at 02:47:53PM -0700, Michael Lewis wrote:
> >
> > LEFT join mfg_vendor_relationship on
> >         mfg_vendor_relationship.mfg_key = mfg_part.mfg_key
> >         AND
> >         mfg_vendor_relationship.project_key = bom_item.project_key
> > LEFT join vendor on
> >         mfg_vendor_relationship.vendor_key = vendor.vendor_key
> >
> 
> Perhaps I am missing something, but it seems like just a matter of changing
> inner join to left so you keep what you already have and augment vendor
> information when it exists. I never use right joins (I re-write to always
> declare as left) so I am not sure if the right join near the top screws
> that up. I might consider using a UNION ALL to combine sets where values
> are NULL with left joins, and use plain (inner) joins for the not nulls.

Thanks. That looks like it gives me what I need.

RE right joins, I just got started doing that, and it is easier for me to
think that way.

-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
                        -- Benjamin Franklin



В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Lewis
Дата:
Сообщение: Re: A JOIN question
Следующее
От: Matthias Apitz
Дата:
Сообщение: How to reset a server error '25P02 in_failed_sql_transaction'