horizzang
asked on
SQL, how can I retrieve top 20 hits?
"INSERT INTO statslog (ip,accesstime,thepage,the type,succe ssCode,the bytes)
VALUES ('$ip','$access_time','$li nk[0]','$l ink[1]','$ success_co de','$byte s')";
I am doing log anaylsis. I inserted these fields into table.
How can I get TOP 20 Hits URL from thepage field?
How can I get TOP 20 IP addres from ip field?
I am using MySQL..so I can't use select TOP 10...
Thank you for your help.
VALUES ('$ip','$access_time','$li
I am doing log anaylsis. I inserted these fields into table.
How can I get TOP 20 Hits URL from thepage field?
How can I get TOP 20 IP addres from ip field?
I am using MySQL..so I can't use select TOP 10...
Thank you for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT thepage,ip,COUNT(ip) AS ipcount FROM statslog GROUP BY ip ORDER BY ip,thepage DESC LIMIT 20;