| From: | Bruno Wolff III <bruno(at)wolff(dot)to> |
|---|---|
| To: | teknokrat <teknokrat(at)yahoo(dot)com> |
| Cc: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: help with troublesome query |
| Date: | 2003-07-15 13:47:47 |
| Message-ID: | 20030715134747.GC10467@wolff.to |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
On Tue, Jul 15, 2003 at 14:26:16 +0100,
teknokrat <teknokrat(at)yahoo(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Henshall, Stuart - TNP Southwest | 2003-07-15 14:31:52 | Re: Cannot insert dup id in pk |
| Previous Message | Viorel Dragomir | 2003-07-15 13:37:31 | Re: summing tables |