| От | Bruno Wolff III |
|---|---|
| Тема | Re: help with troublesome query |
| Дата | |
| Msg-id | 20030715134747.GC10467@wolff.to обсуждение |
| Ответ на | help with troublesome query (teknokrat <teknokrat@yahoo.com>) |
| Список | pgsql-sql |
On Tue, Jul 15, 2003 at 14:26:16 +0100, teknokrat <teknokrat@yahoo.com> wrote: > I have three tables customers which 1-many with requests which is 1-1 > with applications. all customers have at least one request but not all > requests have an application. > > I want a query to return all the customers and their application data if > they have any ( or else null). So this is like a left join of customers > with applications but I do not want multiple rows of customers UNLESS > they have an application. I think you want to first do an inner join of requests and applications and then left join the customers and the previous join.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера