Closed non dupe questions

1

Please login or register to vote for this query.

(click on this box to dismiss)

Closed non duplicate questions, plus total questions and percentage (for the lazy)

Physics

Q&A for active researchers, academics and students of physics

SET NOCOUNT OFF;

DECLARE @Total INT;
  SELECT @Total = COUNT(*) FROM Posts p WHERE p.PostTypeId = 1;

DECLARE @ClosedNonDupes INT
  SELECT @ClosedNonDupes = COUNT(*) FROM PostHistory q WHERE q.PostHistoryTypeId = 10 AND q.Comment != 1;

DECLARE @ClosedAll INT
  SELECT @ClosedAll = COUNT(*) FROM PostHistory q WHERE q.PostHistoryTypeId = 10;

SET NOCOUNT ON;

SELECT @ClosedNonDupes AS [Closed Non Duplicate], @ClosedAll AS [Closed Total], @Total AS [Total Questions], 100 * (@ClosedNonDupes * 1.0 / @Total * 1.0) AS [Percentage NonDupes], 100 * (@ClosedAll * 1.0 / @Total * 1.0) AS [Percentage All];

Enter Parameters

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