DECLARE @TotalDays INT SELECT @TotalDays = DATEDIFF(DAY, ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

DevOps

Q&A for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure

DECLARE @TotalDays INT
SELECT @TotalDays = DATEDIFF(DAY, MIN(CreationDate), MAX(CreationDate)) FROM PostHistory
  
SELECT
  'All', 1.0 * COUNT(*) / @TotalDays 
FROM PostsWithDeleted WHERE PostTypeId = 1
UNION ALL SELECT 
  'All not deleted', 1.0 * COUNT(*) / @TotalDays 
FROM PostsWithDeleted WHERE PostTypeId = 1 AND DeletionDate IS NULL
UNION ALL SELECT 
  'Open and not deleted', 1.0 * COUNT(*) / @TotalDays 
FROM PostsWithDeleted WHERE PostTypeId = 1 AND DeletionDate IS NULL AND ClosedDate IS NULL

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results