Re: exclude part of result

From: "Marc Mamin" <M(dot)Mamin(at)intershop(dot)de>
To: "Harald Fuchs" <hari(dot)fuchs(at)gmail(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: exclude part of result
Date: 2008-06-27 10:50:03
Message-ID: CA896D7906BF224F8A6D74A1B7E54AB3039E8A54@JENMAIL01.ad.intershop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hi,

Two other ideas...

SELECT DISTINCT p.a, p.b, p.c, now(), count(item.item_pk)
FROM product p
JOIN
(select distinct a,b,c from products
except
select distinct a,b,c from navigation
)foo
USING (a,b,c)
LEFT JOIN item ON item.product_fk = product_pk
WHERE ...
GROUP BY p.a, p.b, p.c

or maybe

SELECT DISTINCT foo.*, now(), count(item.item_pk)
FROM (select distinct a,b,c from products
WHERE ...
except
select distinct a,b,c from navigation
)foo
LEFT JOIN item ON item.product_fk = product_pk
WHERE ...
GROUP BY p.a, p.b, p.c

HTH,

Marc Mamin

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tarlika Elisabeth Schmitz 2008-06-27 11:22:38 Re: exclude part of result
Previous Message Harald Fuchs 2008-06-27 09:33:07 Re: exclude part of result