DECLARE @reopens int DECLARE @allclosed int SELECT @reop...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @reopens int
DECLARE @allclosed int

SELECT @reopens = COUNT(CASE WHEN ph.PostHistoryTypeId = 11 THEN 1 ELSE NULL END)
FROM PostHistory ph

SELECT @allclosed = COUNT(*) FROM PostsWithDeleted WHERE ClosedDate IS NOT NULL

SELECT @allclosed = @allclosed + COUNT(*) FROM Posts WHERE ClosedDate IS NOT NULL


SELECT @reopens AS "ReopenedEvents", @allclosed AS "TotalClosed", 100.0*@reopens/@allclosed AS "ReopenPercent"

Enter Parameters

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