• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

sql help needed

I have a table with about 5 million records in it.  I need to find the unique values of a field called URL and the number of times these specific URLs appear in my table.

For example:

URL               id
----------------------------
www.yahoo.com      1
www.lycos.com      2
www.yahoo.com      3

I need a report for the above data to return:

www.yahoo.com   2
www.lycos.com   1


Thanks!
0
kmurphy99
Asked:
kmurphy99
  • 2
1 Solution
 
OlegPCommented:
select url,count(url)
from table
group by url
0
 
OlegPCommented:
With order

select url,count(url)
from table
group by url
order by count(url) desc
0
 
kmurphy99Author Commented:
Thanks!  New to this stuff....
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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