Hello:
I have a MySQL table which logs visitors' IP addresses when they hit pages on my site. One IP address may hit a page multiple times, and is recorded each time into the table as a separate row.
I would like to find out which page receives the most unique visitors by seeing which has the most unique IP addresses. This is the SQL query I am using:
SELECT DISTINCT ip_address, page_id, count( * ) FROM stats GROUP BY page_id ORDER BY `count( * )` DESC
However, count(*) returns the number of TOTAL rows registered for each distinct page... NOT the number of distinct IP Addresses.
How can I modify my query to count distinct IP Addresses? --Thanks!