Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: exclude par...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 3549 of 3799
Post > Topic >>

Re: exclude part of result

by postgresql@[EMAIL PROTECTED] (Tarlika Elisabeth Schmitz) Jun 27, 2008 at 06:40 PM

On Fri, 27 Jun 2008 07:17:11 -0700 (PDT)
Lennin Caro <lennin.caro@[EMAIL PROTECTED]
> wrote:

> 
> select * from (
> 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
> ) t1 where not exists (select a,b,c, from navigation t2 where t2.a =
> t1.a and t2.b = t1.b and t2.c = t1.c)

Many thanks - there seems to be half a dozen ways of achieving the
desired result!


> 
> --- On Thu, 6/26/08, Tarlika Elisabeth Schmitz
> <postgresql@[EMAIL PROTECTED]
> wrote: From: Tarlika Elisabeth
> Schmitz <postgresql@[EMAIL PROTECTED]
> Subject: [SQL] exclude part
> of result To: pgsql-sql@[EMAIL PROTECTED]
> 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 ...
> 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 can I achieve this?


-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 4 Posts in Topic:
exclude part of result
postgresql@[EMAIL PROTECT  2008-06-27 00:35:38 
Re: exclude part of result
andreas.kretschmer@[EMAIL  2008-06-27 08:48:53 
Re: exclude part of result
lennin.caro@[EMAIL PROTEC  2008-06-27 07:17:11 
Re: exclude part of result
postgresql@[EMAIL PROTECT  2008-06-27 18:40:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 21:27:31 CST 2008.