Show the number of posts and edits of each type, sorted by day of the week (UTC). “Initial Title” means a new question; “Initial Body” means a new post (question, answer or tag wiki).
Q&A for anime and manga fans
-- Posts and revisions by day of the week -- Show the number of posts and edits of each type, sorted by day of the week (UTC). -- “Initial Title” means a new question; -- “Initial Body” means a new post (question, answer or tag wiki). SET DATEFIRST 1 SELECT Min(pht.Name) As [Type], Sum(CASE DatePart(Weekday, ph.CreationDate) WHEN 1 THEN 1 ELSE 0 END) As [Monday], Sum(CASE DatePart(Weekday, ph.CreationDate) WHEN 2 THEN 1 ELSE 0 END) As [Tuesday], Sum(CASE DatePart(Weekday, ph.CreationDate) WHEN 3 THEN 1 ELSE 0 END) As [Wednesday], Sum(CASE DatePart(Weekday, ph.CreationDate) WHEN 4 THEN 1 ELSE 0 END) As [Thursday], Sum(CASE DatePart(Weekday, ph.CreationDate) WHEN 5 THEN 1 ELSE 0 END) As [Friday], Sum(CASE DatePart(Weekday, ph.CreationDate) WHEN 6 THEN 1 ELSE 0 END) As [Saturday], Sum(CASE DatePart(Weekday, ph.CreationDate) WHEN 7 THEN 1 ELSE 0 END) As [Sunday] FROM PostHistory ph INNER JOIN PostHistoryTypes pht ON pht.Id = ph.PostHistoryTypeId GROUP BY ph.PostHistoryTypeId ORDER BY ph.PostHistoryTypeId