Q&A about the site for administrators and users of the CiviCRM Constituent Relationship Management software
SELECT P.CreationDate AS [Post_Creation_Date], P.ViewCount AS [Post_View_Count], P.Title AS [Post_Title], P.Body AS [Post_Body], P.Tags AS [Post_Tags], P.Score AS [Post_Score], P.AnswerCount AS [Post_Answer_Count], A.Body AS [Answer_Body], STRING_AGG(R.Score, ',') AS [Response_Scores], P.OwnerUserId AS [Post_Author], A.OwnerUserId AS [Answer_Author] FROM Posts AS P INNER JOIN Posts AS R ON R.ParentId = P.Id AND R.PostTypeId = 2 INNER JOIN Posts AS A ON A.Id = P.AcceptedAnswerId WHERE P.PostTypeId = 1 AND P.CreationDate >= '2021-01-09' GROUP BY P.CreationDate, P.ViewCount, P.Title, P.Body, P.Tags, P.Score, P.AnswerCount, A.Body, P.OwnerUserId, A.OwnerUserId ORDER BY P.CreationDate ASC