complex join question

From: Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: complex join question
Date: 2010-02-12 22:32:49
Message-ID: 20100212223248.GA29691@apartia.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Here is my schema:

cruise_line -> ship(id_line) -> cruise_type(id_ship) -> cruise(id_cruise_type)
-> price(id_cruise, id_currency) <- currency (USD,GBP,EUR,CAD)

(a 'cruise' is a 'cruise_type' + a date)

I am trying to display a count of cruise's for each ship and each
currency even if that count is 0.

But I am having trouble building the query, as some 'cruise's might not
(yet) have a 'price' in all currencies and so no link to 'currency'.

Thanks,

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tim Landscheidt 2010-02-12 23:55:38 Re: complex join question
Previous Message Oliveiros C, 2010-02-12 12:17:35 Re: "left join" not working?