プログラマーとプログラミングに熱心な人々のための質問と回答
SELECT Count(id), CloseCount FROM ( SELECT p.id, count(v.id) CloseCount FROM posts p INNER JOIN votes v ON p.id = v.PostID and v.votetypeid = 6 WHERE p.posttypeid = 1 and not closeddate is null GROUP BY p.id ) t GROUP BY closeCount