From: John Taylor <d_low22003@yahoo.com>
To: pgsql-general@postgresql.org
Subject: Syntax question
Date: Fri, 26 May 2006 09:09:25 -0700 (PDT)
Message-ID: <20060526160925.61343.qmail@web53504.mail.yahoo.com> (raw)
I have a select statement that goes as follows:
SELECT * FROM product prod, prod_alias pa, category cat, company co
WHERE prod.catid = cat.catid
AND prod.coid = co.coid
AND prod.prodid = pa.prodid;
If possible, I want to change the statement so that I get output regardless of whether there's a match between prod.prodid and pa.prodid. IOW, if there's a match between prod.prodid and pa.prodid, I want the output from both the product table and the prod_alias table. if there's no match, I still want the output from product table. Can I do this in one select statement?
Thanks,
Don
---------------------------------
Ring'em or ping'em. Make PC-to-phone calls as low as 1ยข/min with Yahoo! Messenger with Voice.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: d_low22003@yahoo.com
Subject: Re: Syntax question
In-Reply-To: <20060526160925.61343.qmail@web53504.mail.yahoo.com>
References: <20060526160925.61343.qmail@web53504.mail.yahoo.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