Q&A about the site for professional and independent game developers
SELECT q.Id AS QuestionId, q.Title AS QuestionTitle, q.Body AS QuestionBody, a.Id AS AnswerId, a.Body AS AnswerBody, c.Text AS CommentText, c.CreationDate AS CommentCreationDate FROM Posts q LEFT JOIN Posts a ON q.AcceptedAnswerId = a.Id -- Join with the accepted answer LEFT JOIN Comments c ON q.Id = c.PostId OR a.Id = c.PostId -- Join with comments on either the question or the answer WHERE (q.Tags LIKE '%youtube-api%' OR q.Tags LIKE '%youtube-data-api%') AND q.PostTypeId = 1 -- Select only questions AND q.AcceptedAnswerId IS NOT NULL; -- Ensure the question has an accepted answer