instruction: Posts with pending close flags with multiple reasons.
response: WITH cnts AS (SELECT PostId FROM PendingFlags WHERE CloseReasonTypeId IN (101, 102, 103, 104, 105) GROUP BY PostId HAVING COUNT(*) > 2 AND MIN(CloseReasonTypeId) != MAX(CloseReasonTypeId)) SELECT PostId AS "post_link", '101' AS "duplicate", '102' AS "off-topic", '103' AS "unclear", '104' AS "too_broad", '105' AS "opinion_based" FROM (SELECT pf.PostId, Id, CloseReasonTypeId FROM PendingFlags AS pf INNER JOIN cnts ON cnts.PostId = pf.PostId WHERE FlagTypeId IN (13, 14)) AS data PIVOT(COUNT(Id) FOR CloseReasonTypeId IN ('101', '102', '103', '104', '105')) AS pvt