Q&A for music historians, critics, and fans
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 10 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 '2019-01-01' AND '2019-01-31' AND P.PostTypeId = 1 AND LEN(P.Body) <= 2000 -- Restricts body length to 500 characters or fewer AND P.Body NOT LIKE '%<img>%' AND P.Body NOT LIKE '%<rel>%' AND P.Body NOT LIKE '%<a>%' ORDER BY P.Score DESC ) AND LEN(PAccepted.Body) <= 2000 GROUP BY PParent.Body, PAccepted.Score, PAccepted.Body;