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

Поиск
Список
Период
Сортировка
От Bob Dusek
Тема Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?
Дата
Msg-id Pine.LNX.3.96.990428182523.468A-100000@toots.palaver.net
обсуждение исходный текст
Ответ на Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?  ("Gene Selkov, Jr." <selkovjr@mcs.anl.gov>)
Ответы Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?
Список 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


В списке pgsql-general по дате отправления: