| От | Holger Klawitter |
|---|---|
| Тема | counting groups |
| Дата | |
| Msg-id | 39F56E52.C65F5978@klawitter.de обсуждение исходный текст |
| Ответы |
Re: counting groups
|
| Список | pgsql-general |
Hi there,
is there any way to count groups in Postgres ? The following
(simplified) statement should return the number of attributes
which come up more than once.
SELECT count(distinct attr)
FROM table
WHERE condition
GROUP BY attr
HAVING count(*)>1
But it returns just the right number of 1's.
There must be a nicer way than selection INTO a temporary table
and counting from there ...
Regards,
Mit freundlichem Gruß,
Holger Klawitter
--
Holger Klawitter +49 (0)251 484 0637
holger@klawitter.de http://www.klawitter.de/
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера