Re: exclude part of result

From: Tarlika Elisabeth Schmitz <postgresql(at)numerixtechnology(dot)de>
To: pgsql-sql(at)postgresql(dot)org, "Patricia Mitchell"<patricia-mitche(at)excite(dot)com>
Subject: Re: exclude part of result
Date: 2008-06-27 06:51:36
Message-ID: 20080627075136.12add021@dick.coachhouse
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 26 Jun 2008 19:49:01 -0400 (EDT)
"Patricia Mitchell"<patricia-mitche(at)excite(dot)com> wrote:

> The columns (a,b,c) of the navigation table should not appear in the
> result because you are only pulling records from the product and item
> table. You are pulling the records out of the product and item table
> with this statement: 'select a,b,c, count()....from product LEFT
> JOIN item on....'
>
>
>
> P.M.
>
> --- On Thu 06/26, Tarlika Elisabeth Schmitz <
> postgresql(at)numerixtechnology(dot)de > wrote:
>
> From: Tarlika Elisabeth Schmitz [mailto:
> postgresql(at)numerixtechnology(dot)de]
>
> To: pgsql-sql(at)postgresql(dot)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 = 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?

Thank you for your response, Patricia.

Maybe I did not express myself clearly enough:
Example:

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 301 #items
so I can insert them in NAVIGATION. NAVIGATION must not contain any
duplicate combinations of [a,b,c].

--

Best Regards,

Tarlika Elisabeth Schmitz

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Harald Fuchs 2008-06-27 09:33:07 Re: exclude part of result
Previous Message A. Kretschmer 2008-06-27 06:48:53 Re: exclude part of result