What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

I've been trying to find this on the data explorer, but no luck. I need some help to write a query identical to the one found on our profile pages that displays tag information. The query would have to return:

  1. Each tag used by the user
  2. The number of times this tag has been used.
  3. The number of points gained for answers given to questions that use this tag.

I wrote the following so far on data-explorer to get the tags and to the tag count:

SELECT COUNT(tags.tagName), tags.tagName
  FROM postTags
    LEFT JOIN tags ON postTags.tagId = tags.id
    LEFT JOIN posts ON postTags.postId = posts.id
  WHERE posts.ownerUserId = 3
  GROUP BY tags.tagName

But I'm not sure how to get the score count per answer, or item 3 in my list!

Any help would appreciated!

share|improve this question

1 Answer 1

You're on the right track.

I created a query that does a decent approximation:

http://data.stackexchange.com/meta/s/1479/my-tags-on-profile-page

The only difference between this and the My Tags area is that this doesn't include community-wiki post stats (they don't count towards the totals, but the number of posts is included). The query would have to be rewritten slightly to grab data from the Votes table instead (to find the non-CW votes before the post was converted). This is exact if you don't have any CW posts.

share|improve this answer
    
thanks. I guess adding that column goes a long way to complicate the query, huh? I'll have to spend some time playing around with it to see what I can do. I'm debating if it's even worth it at this point--unless I can find a way to do it without creating an additional table on the fly... –  Mohamad Jun 16 '11 at 13:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .