DECLARE @TotalQuestions DECIMAL = ( SELECT COUNT(*) FROM ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

DECLARE @TotalQuestions DECIMAL = (
  SELECT COUNT(*) FROM Posts
);

DECLARE @UnansweredQuestions DECIMAL = (
  SELECT COUNT(*) FROM Posts WHERE AnswerCount = 0
);

SELECT 
  [Type of value] = 'Percentage Of Unanswered Questions'
  , [Value] = (@UnansweredQuestions / @TotalQuestions) * 100.0
UNION
SELECT
  'Percentage Of Answered Questions'
  , 100 - ((@UnansweredQuestions / @TotalQuestions) * 100.0);

Enter Parameters

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