X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9EDBD9FA12E for ; Fri, 26 May 2006 13:16:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 66593-05 for ; Fri, 26 May 2006 13:16:07 -0300 (ADT) X-Greylist: delayed 00:06:39.37586 by SQLgrey- Received: from web53504.mail.yahoo.com (web53504.mail.yahoo.com [206.190.37.65]) by postgresql.org (Postfix) with SMTP id 5DCDC9FA1F1 for ; Fri, 26 May 2006 13:16:07 -0300 (ADT) Received: (qmail 61345 invoked by uid 60001); 26 May 2006 16:09:25 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=YsM41RlCY4WzJAYoaQiSgy9Xkw2UqSxg8az+2aI5XuO1rOARc33IJ4De3puWasow51390e95NTkRM+o2OCub40iBlOUT9KBnKKPZAhP1v0B0QPMOZXM/TBl2LLLcN+yeyZ8tMpmgGm6iMkZAbZMyoMvDvRA0hPORHeVLbGcvEQE= ; Message-ID: <20060526160925.61343.qmail@web53504.mail.yahoo.com> Received: from [70.80.70.56] by web53504.mail.yahoo.com via HTTP; Fri, 26 May 2006 09:09:25 PDT Date: Fri, 26 May 2006 09:09:25 -0700 (PDT) From: John Taylor Subject: Syntax question To: pgsql-general@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-179125195-1148659765=:59117" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/1316 X-Sequence-Number: 96108 --0-179125195-1148659765=:59117 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-179125195-1148659765=:59117 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-179125195-1148659765=:59117--