Q&A for linguists, teachers, and students wanting to discuss the finer points of the Latin language
DECLARE @p_date DATETIME SET @p_date = CONVERT( DATETIME, '01 JAN 2012', 106 ) ( SELECT q.AnswerCount, count(*) numPerguntas, avg(ViewCount) FROM Posts q where q.postTypeId = 1 and q.AnswerCount < 5 group by q.AnswerCount ) UNION ( SELECT 5, count(*) numPerguntas, avg(ViewCount) FROM Posts q where q.postTypeId = 1 and q.AnswerCount >= 5 ) ORDER BY 1