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 3 of 4 Topic 3549 of 3799
Post > Topic >>

Re: exclude part of result

by lennin.caro@[EMAIL PROTECTED] (Lennin Caro) Jun 27, 2008 at 07:17 AM

--0-222558141-1214576231=:24823
Content-Type: text/plain; charset=us-ascii


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)

--- 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]
 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?

--


Best Regards,

Tarlika Elisabeth Schmitz


A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad? 

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


      
--0-222558141-1214576231=:24823
Content-Type: text/html; charset=us-ascii

<table cellspacing='0' cellpadding='0' border='0' ><tr><td valign='top'
style='font: inherit;'><br>select * from (<br>SELECT DISTINCT a, b, c,
now(), count(item_pk)<br>FROM product<br>LEFT JOIN item ON item.product_fk
= product_pk<br>WHERE ...<br>GROUP BY a, b, c<br>) 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)<br><br>--- On <b>Thu, 6/26/08, Tarlika Elisabeth Schmitz
<i>&lt;postgresql@[EMAIL PROTECTED]
></b> wrote:<br><blockquote
style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px;
padding-left: 5px;">From: Tarlika Elisabeth Schmitz
&lt;postgresql@[EMAIL PROTECTED]
>Subject: [SQL] exclude part of
result<br>To: pgsql-sql@[EMAIL PROTECTED]
>Date: Thursday, June 26, 2008,
11:35 PM<br><br><pre>SELECT DISTINCT a, b, c, now(), count(item_pk)
<br>FROM product<br>LEFT JOIN item ON item.product_fk =
product_pk<br>WHERE ...<br>GROUP BY a, b, c<br><br><br>I have another
table
 'navigation' which also has the columns a,b,c<br><br>If the combination
of (a,b,c) exists in 'navigation', then exclude it<br>from above result.
How can I achieve this?<br><br>--<br><br><br>Best Regards,<br><br>Tarlika
Elisabeth Schmitz<br><br><br>A: Because it breaks the logical sequence of
discussion<br>Q: Why is top posting bad? <br><br>-- <br>Sent via pgsql-sql
mailing list (pgsql-sql@[EMAIL PROTECTED]
)<br>To make changes to your
subscription:<br>http://www.postgresql.org/mailpref/pgsql-sql</pre></blockquote></td></tr></table><br>



      
--0-222558141-1214576231=:24823--
 




 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:38:30 CST 2008.