--- On Tue, 9/30/08, r_musta <[EMAIL PROTECTED]> wrote:
> From: r_musta <[EMAIL PROTECTED]>
> Subject: Re: [GENERAL] Counting unique rows as an aggregate.
> To: pgsql-general@postgresql.org
> Date: Tuesday, September 30, 2008, 6:55 AM
> On Sep 30, 2:36 am, [EMAIL
I must be missing something, because I don't see why you couldn't do
SELECT count(distinct make), count(distinct color) from table WHERE
>criteria<;
I didn't explain well, I want the count of each distinct value in a
column, eg, if the color column has 50 rows, 20x'red', 10x'green',
20x'blue'
On Sep 30, 2:36 am, [EMAIL PROTECTED] (Tom Lane) wrote:
> > SELECT count_unique(make), count_unique(color) from table WHERE >criteria<;
>
> I must be missing something, because I don't see why you couldn't do
> SELECT count(distinct make), count(distinct color) from table WHERE
> >criteria<;
I di
On Sep 29, 11:25 pm, [EMAIL PROTECTED] ("Scott Marlowe") wrote:
> > However, this is starting to become too slow (as there are about 10 of
> > these queries), and therefore I need to write an aggregate function
> > which lets me do:
>
> >>SELECT count_unique(make), count_unique(color) from table WH
Richard Broersma wrote:
On Mon, Sep 29, 2008 at 4:36 PM, Tom Lane <[EMAIL PROTECTED]> wrote:
> SELECT count(distinct make), count(distinct color) from table WHERE
>criteria<;
Is this in the SQL spec? I didn't know Agg functions could do this?
Yes. SQL92 6.5
::=
COUNT
On Mon, Sep 29, 2008 at 4:36 PM, Tom Lane <[EMAIL PROTECTED]> wrote:
> SELECT count(distinct make), count(distinct color) from table WHERE
> >criteria<;
Is this in the SQL spec? I didn't know Agg functions could do this?
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL User
r_musta <[EMAIL PROTECTED]> writes:
> However, this is starting to become too slow (as there are about 10 of
> these queries), and therefore I need to write an aggregate function
> which lets me do:
> SELECT count_unique(make), count_unique(color) from table WHERE >criteria<;
I must be missing so
On Mon, Sep 29, 2008 at 12:12 PM, r_musta <[EMAIL PROTECTED]> wrote:
> However, this is starting to become too slow (as there are about 10 of
> these queries), and therefore I need to write an aggregate function
> which lets me do:
>
>>SELECT count_unique(make), count_unique(color) from table WHERE