pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-sql@postgresql.org
Subject: COUNT DISTINCT?
Date: Tue, 30 Jul 2002 14:27:18 -0700
Message-ID: <200207301427.18815.josh@agliodbs.com> (raw)

Folks,

Anybody know a keen shortcut for the following:

SELECT count(skip_date) 
FROM (SELECT DISTINCT skip_date FROM weekend_list
		WHERE ... ...) days_to_skip;

That's a double aggregate, and is bound to be dog-slow.

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




view thread (3+ messages)  latest in thread

Message-ID: <200207301427.18815.josh@agliodbs.com>
Permalink:  ../200207301427.18815.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200207301427.18815.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com
  Subject: Re: COUNT DISTINCT?
  In-Reply-To: <200207301427.18815.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox