Re: exclude part of result

Поиск
Список
Период
Сортировка
От Tarlika Elisabeth Schmitz
Тема Re: exclude part of result
Дата
Msg-id 20080627184021.7397d531@dick.coachhouse
обсуждение исходный текст
Ответ на Re: exclude part of result  (Lennin Caro <lennin.caro@yahoo.com>)
Список pgsql-sql
On Fri, 27 Jun 2008 07:17:11 -0700 (PDT)
Lennin Caro <lennin.caro@yahoo.com> 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@numerixtechnology.de> wrote: From: Tarlika Elisabeth
> Schmitz <postgresql@numerixtechnology.de> Subject: [SQL] exclude part
> of result To: pgsql-sql@postgresql.org
> 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?



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

Предыдущее
От: Louis-David Mitterrand
Дата:
Сообщение: Re: dynamic events categorization
Следующее
От: Gavin 'Beau' Baumanis
Дата:
Сообщение: distinct / group by assistance.