Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?

From: Bob Dusek <bobd(at)palaver(dot)net>
To: "Gene Selkov, Jr(dot)" <selkovjr(at)mcs(dot)anl(dot)gov>
Cc: Aaron Holtz <aholtz(at)bright(dot)net>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?
Date: 1999-04-28 23:28:53
Message-ID: Pine.LNX.3.96.990428182523.468A-100000@toots.palaver.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hey there...

> SELECT customer_username, COUNT(customer_username) FROM customerdata GROUP BY customer_username;
>

The above query, in effect, does the same thing that:

SELECT DISTINCT(customer_username) from customerdata

does. In order to get the total number of distinct customer_usernames,
you would still have to count the rows returned (which is easily
enough done with PHP $count = pg_NumRows($query_result)).

My guess is that SELECT DISTINCT might even be a bit quicker...?? (gurus)

>

Bob

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Good 1999-04-29 00:07:19 Re: [GENERAL] UnixWare chokes
Previous Message Thomas Good 1999-04-28 23:16:09 Re: [GENERAL] UnixWare chokes