SELECT Posts.Id, count(Tags) AS TagsCount FROM Posts INNE...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Skeptics

Q&A for scientific skepticism

-- For each question (i.e. posts where type = question), count the total 
-- number of tags – do this only for posts that have more than 5 tags associated 
-- with them. Display 10 random posts with the highest number of tags.
SELECT 
  Posts.Id,
  count(Tags) AS TagsCount
FROM Posts INNER JOIN PostTypes
    ON (Posts.PostTypeId = PostTypes.Id)
WHERE PostTypes.Name = 'Question'
GROUP BY Posts.Id
ORDER BY TagsCount DESC
OFFSET 0 ROWS FETCH FIRST 10 ROWS ONLY;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results