Hot questions by posting day of week/time

0

Please login or register to vote for this query.

(click on this box to dismiss)

Worldbuilding

Q&A for writers/artists using science, geography and culture to construct imaginary worlds and settings

declare @hoursToGroup int = ##hoursToGroup:int?4##;

-- Sunday = 1, Saturday = 7
select (datepart(weekday, p.creationdate) - 1) * (24 / @hoursToGroup) +
        datepart(hour, p.creationdate) / @hoursToGroup,
        count(h.id) * 100.0 / count(*)
  from posts as p
  left outer join posthistory as h
    on h.postid = p.id and h.posthistorytypeid = 52
  where p.creationdate >= '2019-03-01' -- start date for HNQ entry records
  group by datepart(weekday, p.creationdate),
           datepart(hour, p.creationdate) / @hoursToGroup
  order by 1

Enter Parameters

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