Q by day stats

0

Please login or register to vote for this query.

(click on this box to dismiss)

Enter Query Description

Stack Overflow

Q&A for professional and enthusiast programmers

-- Q by day stats
-- Enter Query Description

set nocount on

declare @QStats table (PostId int, zeday char(8), views int) 

insert @QStats
select
    Id, 
    CONVERT(char(8),CreationDate,112),
    ViewCount
from Posts
where ParentId IS NULL;


SELECT distinct zeday, count(views) as totq, sum(views) as totv, 1+1 as [ab] FROM @QStats  GROUP BY zeday

Enter Parameters

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