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

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, count(t.tid) as tcnt
  from
  (select users.id as uid, 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, tags.id) as t
  group by t.uid
  order by tcnt desc

Enter Parameters

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