From: Richard Huxton <dev@archonet.com>
To: Amit_Wadhwa@Dell.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Complex Query - Data from 3 tables simultaneously
Date: Thu, 27 Oct 2005 10:17:27 +0100
Message-ID: <43609B27.6060303@archonet.com> (raw)
In-Reply-To: <4538E1203665624F97A8494BCF2716E5F4853F@blrx2kmbgl102.blr.amer.dell.com>
References: <4538E1203665624F97A8494BCF2716E5F4853F@blrx2kmbgl102.blr.amer.dell.com>
Amit_Wadhwa@Dell.com wrote:
>
> Basically I want a raw dump of data
> - Should have all the shipments regardless of whether they have any
> material items entered or not
> - Should have all Material Items for Every Shipment regardless of
> whether it was issued or not.
>
> I know I need an outer join (Do I Not?), but am confused as to how to
> implement it.
> Because this seems to be a requirement of a reversed outer join (??)
SELECT s.*, m.*, i.*
FROM
shipments s
LEFT JOIN
materials m
ON s.www = m.xxx
LEFT JOIN
issued i
ON m.yyy = i.zzz
WHERE
s.whatever = something
--
Richard Huxton
Archonet Ltd
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: dev@archonet.com, Amit_Wadhwa@Dell.com
Subject: Re: Complex Query - Data from 3 tables simultaneously
In-Reply-To: <43609B27.6060303@archonet.com>
* 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