Re: left outer join on 3 tables ?

From: "Michael Nolan" <htfoot(at)gmail(dot)com>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: left outer join on 3 tables ?
Date: 2008-09-16 02:52:23
Message-ID: 4abad0eb0809151952rdf9f366u65ba72f7e0b7b65d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Try:

select e.name, w.rate, d.level

from employees e left join wage w on (e.job = w.job)
left join danger d on (d.job = e.job)

where d.level <= 2;

name rate level
---- ---- -----
sue -N- 1
alan 20 2

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brent Wood 2008-09-16 03:12:53 Help with a foreign key with non-unique reference?
Previous Message Gauthier, Dave 2008-09-16 02:28:06 left outer join on 3 tables ?