How many not owner's edits per question.

1

Please login or register to vote for this query.

(click on this box to dismiss)

スタック・オーバーフロー

プログラマーとプログラミングに熱心な人々のための質問と回答

SELECT
    t.EditCount as 'EditsPerQuestion',
    COUNT(t.EditCount) as 'Cases'
FROM (
  SELECT
    COUNT(p.Id) as EditCount
  FROM
    Posts as p
    INNER JOIN PostHistory as ph ON ph.PostId = p.Id
  WHERE
    p.PostTypeId = 1
    AND p.OwnerUserId != ph.UserId
  GROUP BY p.Id
) as t
GROUP BY t.EditCount
ORDER BY t.EditCount DESC

-- It is out of consideration of PostHistoryTypeId.
-- See: http://meta.stackexchange.com/questions/2677 if you want.

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results