2

I am curious to know:

  1. Who asked the highest-voted question?
  2. What is the question?
  3. Who had the highest-voted answer to the question?

There is no option currently in SO to view the highest-voted (most popular) question and answers in each tag.

It would be really nice to see this.

The hot listing only shows the top voted question (and that is off-topic).

migrated from stackoverflow.com Sep 4 '09 at 13:35

This question came from our site for professional and enthusiast programmers.

5

It's easily possible to see the highest voted question by tag. Just click on the tag and then click the "votes" tab.

  • thanks Joel.. i got it.. – RameshVel Sep 4 '09 at 13:52
0

This is already possible, using the SO Data Dump that's publicly available. Don't know exactly from where, though - I never used it myself...

  • mmm okie... but its really hard to see most popular questions using that option.. it would be nice if this is part of SO... – RameshVel Sep 4 '09 at 13:42
0

You can use the sandbox to do such queries. The anatomy of a data dump gives you the structure of the tables.

Just search for posts with the right PostTypeId for answer or question that include a certain tag in Tags, order by votes descending and retrieve just one record. You can the retrieve the user by OwnerUserId.

As Joel pointed out the highest voted question per tag is easily found. But in the sandbox you can search for other criteria as well. Just use standard SQL queries.

0

This SEDE query does the job:

enter image description here

It returns Why is it faster to process a sorted array than an unsorted array? as the highest scoring question, and the highest scoring answer is also on this question (but that could be different).

For reference, here is the complete query (it could probably be written in a more efficient way, but it's just an adaptation of this query):

SELECT TagName,
  QuestionID AS [Post Link], q_.OwnerUserId AS [User Link], q_.Score AS [Q score],
  AnswerID AS [Post Link], a_.OwnerUserId AS [User Link], a_.Score AS [A score]
FROM
(SELECT TagName,
  (SELECT TOP 1 q.Id
     FROM Posts AS q INNER JOIN PostTags AS qt ON q.Id = qt.PostId
     WHERE qt.TagId = t.Id ORDER BY q.Score DESC) AS QuestionID,
  (SELECT TOP 1 a.Id
     FROM Posts AS a INNER JOIN PostTags AS at ON a.ParentId = at.PostId
     WHERE at.TagId = t.Id ORDER BY a.Score DESC) AS AnswerID
  FROM Tags AS t
  WHERE t.TagName = ##TagName:string##) AS temp
  INNER JOIN Posts AS q_ ON temp.QuestionId = q_.Id
  LEFT OUTER JOIN Posts AS a_ ON temp.AnswerId = a_.Id

Note that SEDE is updated once a week, on Sunday morning, so the post scores could be a little bit off.

You must log in to answer this question.

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