Wednesday, December 14, 2011

How to Get the Hits from any IP Address??

I was thinking of if we can get the counts of hits from IP Addresses on my site.

Well - got a small query that needs to be run on the Analytics database which would return the hits:-

SELECT TOP (10)[IpAddress],[IpId],COUNT (IpAddress) AS 'Total count'
  FROM [Session]
  GROUP BY [IpAddress],[IpId]
  ORDER BY [Total count] DESC
GO