Re: Complex Query - Data from 3 tables simultaneously

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Complex Query - Data from 3 tables simultaneously
Дата
Msg-id 43609B27.6060303@archonet.com
обсуждение исходный текст
Ответ на Complex Query - Data from 3 tables simultaneously  (<Amit_Wadhwa@Dell.com>)
Список pgsql-sql
Amit_Wadhwa@Dell.com wrote:
>  
> Basically I want a raw dump of data
> - Should have all the shipments regardless of whether they have any
> material items entered or not
> - Should have all Material Items for Every Shipment regardless of
> whether it was issued or not.
>  
> I know I need an outer join (Do I Not?), but am confused as to how to
> implement it.
> Because this seems to be a requirement of a reversed outer join (??)

SELECT s.*, m.*, i.*
FROM  shipments s
LEFT JOIN  materials m
ON s.www = m.xxx
LEFT JOIN  issued i
ON m.yyy = i.zzz
WHERE s.whatever = something

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: handling money type
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: why vacuum