Re: [SQL] exclude part of result

2008-06-27 Thread Tarlika Elisabeth Schmitz
beth > Schmitz <[EMAIL PROTECTED]> Subject: [SQL] exclude part > of result To: pgsql-sql@postgresql.org > Date: Thursday, June 26, 2008, 11:35 PM > > SELECT DISTINCT a, b, c, now(), count(item_pk) > FROM product > LEFT JOIN item ON item.product_fk = product_pk > WHERE ... &

Re: [SQL] exclude part of result

2008-06-27 Thread Lennin Caro
Schmitz <[EMAIL PROTECTED]> wrote: From: Tarlika Elisabeth Schmitz <[EMAIL PROTECTED]> Subject: [SQL] exclude part of result To: pgsql-sql@postgresql.org Date: Thursday, June 26, 2008, 11:35 PM SELECT DISTINCT a, b, c, now(), count(item_pk) FROM product LEFT JOIN item ON ite

Re: [SQL] exclude part of result

2008-06-27 Thread Tarlika Elisabeth Schmitz
On Fri, 27 Jun 2008 11:33:07 +0200 Harald Fuchs <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Tarlika Elisabeth Schmitz <[EMAIL PROTECTED]> writes: > > > PRODUCT table : > > > A B C > > 100 200 300 > > 100 200 301 > > 100 205 300 > > 100 205 301 > > > NAVIGATION table > > A B C

Re: [SQL] exclude part of result

2008-06-27 Thread Marc Mamin
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 WHER

Re: [SQL] exclude part of result

2008-06-27 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, Tarlika Elisabeth Schmitz <[EMAIL PROTECTED]> writes: > PRODUCT table : > A B C > 100 200 300 > 100 200 301 > 100 205 300 > 100 205 301 > NAVIGATION table > A B C #ITEMS > 100 200 300 5 > 100 200 301 6 > My query needs to return > 100 205 300 #items > 100 205 30

Re: [SQL] exclude part of result

2008-06-26 Thread Tarlika Elisabeth Schmitz
z [mailto: > [EMAIL PROTECTED] > > To: pgsql-sql@postgresql.org > > Date: Fri, 27 Jun 2008 00:35:38 +0100 > > Subject: [SQL] exclude part of result > > > SELECT DISTINCT a, b, c, now(), count(item_pk) > FROM product > LEFT JOIN item ON item.product_fk = prod

Re: [SQL] exclude part of result

2008-06-26 Thread A. Kretschmer
am Fri, dem 27.06.2008, um 0:35:38 +0100 mailte Tarlika Elisabeth Schmitz folgendes: > > SELECT DISTINCT a, b, c, now(), count(item_pk) > FROM product > LEFT JOIN item ON item.product_fk = product_pk > WHERE ... > GROUP BY a, b, c > > > I have another table 'navigation' which also has the co

[SQL] exclude part of result

2008-06-26 Thread Tarlika Elisabeth Schmitz
SELECT DISTINCT a, b, c, now(), count(item_pk) FROM product LEFT JOIN item ON item.product_fk = product_pk WHERE ... GROUP BY a, b, c I have another table 'navigation' which also has the columns a,b,c If the combination of (a,b,c) exists in 'navigation', then exclude it from above result. How