Using SEDE I'm trying to get the TagWikis along with their corresponding Tags.

This is what I tried (but i get an empty result):

select Body,TagName from Posts
inner join PostTags on PostTags.PostId=Posts.Id
inner join Tags on Tags.id=PostTags.TagId
where PostTypeId=5


Getting the TagWikis alone is no problem, using something like:

select top 10 * from Posts
where PostTypeId=5


But in the PostTags table there is no corresponding PostId for Posts with PostTypeId=5, so this query returns an empty result:

select * from Posts
inner join PostTags on PostTags.PostId=Posts.Id
where PostTypeId=5


Is there a way to accomplish this? (or am I just missing something obvious?)

  • 1
    Uh...huh. Yeah, seems like the necessary data is missing. Not sure if there are supposed to be PostTags entries for tag wikis, or if Tags is meant to have foreign keys to Posts for the excerpt and body...
    – Tim Stone
    May 1, 2012 at 22:44

2 Answers 2


Sam Saffron has revealed the mysteries of the data explorer to me - getting the excerpt and wiki posts associated with a tag is now possible.


  • 2
    Ah, so you know about the blood sacrifice now then...
    – Tim Stone
    Jun 14, 2012 at 18:48
  • 4
    THAT IS MY FAVORITE PART. Jun 14, 2012 at 18:59
  • Nice and simple (from our end). Thanks! Jun 14, 2012 at 22:15

Until the necessary data is added, if you're primarily interested in actually viewing the tag wiki on the site, you can use the [Post Link] magic column to generate a link that will take you to the correct tag wiki (whichever tag it happens to belong to).

  • That only gives a link which is redirected on the HTTP server to the tag wiki. How can I get the tag name for further use in a query? Jun 13, 2012 at 21:44
  • Right, the data required to do so is simply not there at the moment. It's an oversight, but not one that I'm able to directly correct; I'll see what I can do about requesting that it be fixed (assuming your bounty doesn't take care of that).
    – Tim Stone
    Jun 13, 2012 at 21:46

You must log in to answer this question.

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