Re: exclude part of result

Поиск
Список
Период
Сортировка
От Tarlika Elisabeth Schmitz
Тема Re: exclude part of result
Дата
Msg-id 20080627075136.12add021@dick.coachhouse
обсуждение исходный текст
Ответ на exclude part of result  (Tarlika Elisabeth Schmitz <postgresql@numerixtechnology.de>)
Список pgsql-sql
On Thu, 26 Jun 2008 19:49:01 -0400 (EDT)
"Patricia Mitchell"<patricia-mitche@excite.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@numerixtechnology.de > wrote:
> 
> From: Tarlika Elisabeth Schmitz [mailto:
> postgresql@numerixtechnology.de]
> 
> 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 = 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? 


В списке pgsql-sql по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: exclude part of result
Следующее
От: Harald Fuchs
Дата:
Сообщение: Re: exclude part of result