Re: COUNT DISTINCT - Mailing list pgsql-general

From Bruce Momjian
Subject Re: COUNT DISTINCT
Date
Msg-id 200007171325.JAA00431@candle.pha.pa.us
Whole thread Raw
In response to RE: COUNT DISTINCT  ("Eric Jain" <jain@gmx.net>)
Responses Re: COUNT DISTINCT  (Jeff Waugh <jdub@aphid.net>)
List pgsql-general
[ Charset ISO-8859-1 unsupported, converting... ]
> > Depending on what you want, you might be able to just get away with
> > using coalesce on each of them...
> >
> > select count (distinct ( coalesce(text(advert_no), 'NULL') ||
> > coalesce(text(pool_id), 'NULL' ) ) ) from redirect;
>
> Great... This works perfectly. A bit of a monster though :-)

Hey, we didn't design SQL, we just implement it.  :-)

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: "Larry Rogers"
Date:
Subject: Trouble with RPM
Next
From: "Alex Bolenok"
Date:
Subject: Re: urgent help on function/trigger