Percentage Closed as Exact Duplicates of Total

0

Please login or register to vote for this query.

(click on this box to dismiss)

Blender

Q&A for people who use Blender to create 3D graphics, animations, or games

SET NOCOUNT OFF;

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

DECLARE @ClosedDupes INT
SELECT @ClosedDupes = COUNT(*) FROM PostHistory q WHERE q.PostHistoryTypeId = 10 AND q.Comment = 101;

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

SET NOCOUNT ON;

SELECT @ClosedDupes AS [Closed As exact Duplicate], @ClosedAll AS [Closed Total], @Total AS [Total Questions], 100 * (@ClosedDupes * 1.0 / @Total * 1.0) AS [Percentage Dupes], 100 * (@ClosedAll * 1.0 / @Total * 1.0) AS [Percentage All];

Enter Parameters

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