Re: left outer join on more than 2 tables?

From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
To: Gavin Baumanis <gavinb(at)eclinic(dot)com(dot)au>
Cc: Carol Cheung <cacheung(at)consumercontact(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: left outer join on more than 2 tables?
Date: 2009-06-16 22:45:03
Message-ID: 396486430906161545u512acc33lbd67f78174434509@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Jun 16, 2009 at 2:39 PM, Gavin Baumanis<gavinb(at)eclinic(dot)com(dot)au> wrote:
> At the risk of being wrong.... (I'm always ready to learn something new) -
> and seemingly I'm only too happy to be wrong!...
>
> And... it might even be that it is exactly the same result - but I would
> have proposed;
>
> SELECT
>    R.region_name,
>    Count(*) AS RegionComplaints
> FROM
>    Region AS R
>        LEFT JOIN City AS Ci
>            LEFT JOIN Complaint AS Cm ON Ci.id = Cm.city_id
>      ON R.id = C.region_id
> GROUP BY
>    R.region_name;

Yup, it produces the same result.

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma 2009-06-16 22:50:21 Re: left outer join on more than 2 tables?
Previous Message Hall, Crystal M CTR DISA JITC 2009-06-16 21:52:14 Re: left outer join on more than 2 tables? (UNCLASSIFIED)