I have a mysql table like:
id, visitorid, pageid
When a visitor hits the website it stores their visitor id and the page id as a row.
Try using following query
SELECT COUNT(a.page_visits) AS no_of_visitors, a.page_visits AS page_count FROM( SELECT COUNT(DISTINCT pageid) AS page_visits FROM vislog GROUP BY visid) AS a GROUP BY a.page_visits;
Hope it helps...