pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: teknokrat <teknokrat@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: help with troublesome query
Date: Tue, 15 Jul 2003 08:47:47 -0500
Message-ID: <20030715134747.GC10467@wolff.to> (raw)
In-Reply-To: <bf0vdv$3pi$1@localhost.localdomain>
References: <bf0vdv$3pi$1@localhost.localdomain>

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.



view thread (2+ messages)

Message-ID: <20030715134747.GC10467@wolff.to>
Permalink:  ../20030715134747.GC10467@wolff.to/
Also on:    postgresql.org/message-id/20030715134747.GC10467@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, teknokrat@yahoo.com
  Subject: Re: help with troublesome query
  In-Reply-To: <20030715134747.GC10467@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox