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

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?)

share|improve this question
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 '12 at 22:44

2 Answers 2

up vote 7 down vote accepted

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.


share|improve this answer
Ah, so you know about the blood sacrifice now then... – Tim Stone Jun 14 '12 at 18:48
THAT IS MY FAVORITE PART. – Jarrod Dixon Jun 14 '12 at 18:59
Nice and simple (from our end). Thanks! – Gilles Jun 14 '12 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).

share|improve this answer
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? – Gilles Jun 13 '12 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 '12 at 21:46

You must log in to answer this question.

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