ความคิดเห็นของผู้ใช้จัดกลุ่มตามโพสต์ ไม่จำเป็นต้องใช้ตารางทั้งหมด
User's comments grouped by post.It is not neccessary to use all the tables.
 ReviewTaskStates:  Id [ number]  Name [ text]  Description [ text] 
WITH commentStats AS (SELECT COUNT(Id) AS numC, MAX(Id) AS dId, MAX(CreationDate) AS dDate, PostId FROM Comments WHERE UserId = '##UserId##' GROUP BY PostId) SELECT CASE WHEN p.PostTypeId = 1 THEN 'Q' ELSE 'A' END AS "q/a", cs.numC AS "num_cmts", cs.dDate AS Latest, cs.PostId AS "post_link", c.Text AS "last_comment" FROM commentStats AS cs INNER JOIN Comments AS c ON c.Id = cs.dId INNER JOIN Posts AS p ON p.Id = cs.PostId ORDER BY cs.dDate DESC