Q&A for ebook publishers and readers
SELECT PParent.Body AS QuestionBody, PAccepted.Score AS AnswerScore, PAccepted.Body AS AnswerBody, STRING_AGG(T.TagName, ', ') AS QuestionTags -- Concatenates all tag names with a comma separator FROM Posts AS PParent JOIN Posts AS PAccepted ON PParent.AcceptedAnswerId = PAccepted.Id JOIN PostTags AS PT ON PParent.Id = PT.PostId JOIN Tags AS T ON PT.TagId = T.Id WHERE PParent.Id IN ( SELECT TOP 6 P.Id FROM Posts AS P JOIN PostTags AS PT ON P.Id = PT.PostId WHERE (PT.TagId = 16 OR PT.TagId = 3 OR PT.TagId = 17) -- Using the tagID for 'python', 'java', 'javascript' AND P.CreationDate BETWEEN '2018-12-01' AND '2018-12-31' AND P.PostTypeId = 1 ORDER BY P.Score DESC ) GROUP BY PParent.Body, PAccepted.Score, PAccepted.Body;