select top(100) t.uid, t.uname, count(t.tid) as tcnt from...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select top(100) t.uid, t.uname, count(t.tid) as tcnt
  from
  (select users.id as uid, users.displayname as uname, tags.id as tid
    from users, posts, posttags, tags
    where users.id = posts.owneruserid and posttags.postid = posts.id and tags.id = posttags.tagid
    group by users.id, users.displayname, tags.id) as t
  group by t.uid, t.uname
  order by t.uid

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results