t-sql find top 10 users in tabel

  • hi guys,

    I'm new to this forum so I hope I'm posting in the right forum.

    question is:

    I have a table which holds activities from users.

    1 activity = 1 record.

    I want the the top 10 users with the most activities.

    I'm kinda new to this whole sql thing, so I can't really figure it out.

    can someone help here? thanks a bunch!

  • [font="Courier New"]select top 10 user,count(activity) 'Activity_Count'

    from tablename

    group by user

    order by count(activity) desc[/font]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply