RE: COUNT DISTINCT

From: "Eric Jain" <jain(at)gmx(dot)net>
To: "Andrew McMillan" <Andrew(at)catalyst(dot)net(dot)nz>
Cc: "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: RE: COUNT DISTINCT
Date: 2000-07-16 16:02:32
Message-ID: NCBBJFHBEGOIAHBCBNCLEEFCCJAA.jain@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > SELECT count(DISTINCT url) FROM log; does work. The problem is to
> > extend the DISTINCT over several fields...
>
> Right - I should have looked closer shouldn't I :-)
>
> What about...
>
> advert=# select count( distinct ( (text(advert_no) ||
> text(pool_id)) ) )
> from redirect;

Good idea! Unfortunatly this ignores all rows with NULL in either of
the fields...

I guess if I'm a bit patient one day pgsql will allow for something
like:

SELECT COUNT(SELECT DISTINCT url,id FROM log) FROM log;

--
Eric Jain

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2000-07-16 18:53:17 RE: COUNT DISTINCT
Previous Message Philip Warner 2000-07-16 10:49:35 pg_dump with BLOBS & V7.0.2 UPDATED