Re: Getting statistics from tables - Mailing list pgsql-general

From Fran Fabrizio
Subject Re: Getting statistics from tables
Date
Msg-id 3CB32631.7010704@mmrd.com
Whole thread Raw
In response to Getting statistics from tables  (Paulo Jan <admin@digital.ddnet.es>)
List 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 by date:

Previous
From: Paulo Jan
Date:
Subject: Getting statistics from tables
Next
From: Matthew Stanfield
Date:
Subject: Re: PostgreSQL and C#