Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

Retrieve unique values in a table and rank by number of times they occur

We have a table recording hits on our web site. How could we write a query to retrieve unique IP addresses AND. The number of times each IP address occurs?

Thanks in advance
0
nhmedia
Asked:
nhmedia
2 Solutions
 
LIONKINGCommented:
SELECT ip_address, COUNT(*) AS Times_Hit
FROM myHitTable
GROUP BY ip_address
0
 
mmr159Commented:
SELECT ip_address,COUNT(ip_address) AS cnt
FROM table_name
GROUP BY ip_address
0
 
nhmediaAuthor Commented:
Thanks, both solutions  worked a treat
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now