Re: Getting statistics from tables

Поиск
Список
Период
Сортировка
От Fran Fabrizio
Тема Re: Getting statistics from tables
Дата
Msg-id 3CB32631.7010704@mmrd.com
обсуждение исходный текст
Ответ на Getting statistics from tables  (Paulo Jan <admin@digital.ddnet.es>)
Список pgsql-general
>               Users   |   Pages
>           -----------------------------
>               pepe    |   index.html
>               johnsen |   about.html
>               paco    |   about.html
>               paco    |   index.html
>               pepe    |   download.html
>
>
>     It's easy to see the last 5, or 10, or 15 pages that an user has seen,
> or the last users that have viewed a page. But how can I find out the 5
> most seen pages

It's an easier problem than you think. =)

select pages, count(*) from table group by pages order by count(*) desc
limit 5;




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

Предыдущее
От: Paulo Jan
Дата:
Сообщение: Getting statistics from tables
Следующее
От: Matthew Stanfield
Дата:
Сообщение: Re: PostgreSQL and C#