Per hour distribution of posts, comments and edits of a user.
Looks great as a graph.
Q&A for professional and enthusiast programmers
-- Distribution of User Activity Per Hour
-- Per hour distribution of posts and comments of a user.
declare @UserId int = ##UserId##
select h.hours as [Hour], count(counter) as AmountOfActivity
select datepart(hour, creationdate) as active, 1 as counter from posts where owneruserid = @UserId
select datepart(hour, creationdate) as active, 1 as counter from comments where userid = @UserId
) as a
select distinct datepart(hour, CreationDate) as hours from posts
) as h on a.active = h.hours
group by h.hours
order by h.hours