Enter Query Description
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, votes int) insert @QStats select Id, CONVERT(char(8),CreationDate,112), ViewCount, Score from Posts where PostTypeId =1; SELECT count(PostId) as totqb, sum(views) as totv, votes as totrep, '-' as [-] FROM @QStats GROUP BY votes;