Count edits per day

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT 
        CAST(ph.CreationDate AS DATE) as date,
        COUNT(ph.Id) as count_edits
FROM PostHistory ph
INNER JOIN Posts p 
  ON (p.Id = ph.PostId AND 
      p.OwnerUserId != ph.UserId AND
      ph.PostHistoryTypeId  in (1, 2, 3, 4, 5, 6))
GROUP BY CAST(ph.CreationDate AS DATE);

-- SELECT 
--         CAST(p.CreationDate AS DATE) as date,
--         COUNT(p.Id) as count_posts
-- FROM Posts p
-- WHERE (p.PostTypeId  IN (1,2))
-- GROUP BY CAST(p.CreationDate AS DATE);

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results