ASP/SQL Most Common Records - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ASP/SQL Most Common Records

I have a script which tracks the referring page and logs them to a database. I need to write a script that will pull the Top 10 referring pages. How would I go about doing this? Any Help would be greatly appreciated.

Comments

  • ManningManning Posts: 1,621Member
    : I have a script which tracks the referring page and logs them to a database. I need to write a script that will pull the Top 10 referring pages. How would I go about doing this? Any Help would be greatly appreciated.

    This should do what you want:

    SELECT TOP 10 some_column, COUNT(*) AS Cnt FROM some_table GROUP BY some_column ORDER BY Cnt DESC


Sign In or Register to comment.