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


|