Question 4

0

Please login or register to vote for this query.

(click on this box to dismiss)

Korean Language

Q&A for linguists, teachers and students of the Korean language

SELECT 
    (SELECT COUNT(*) FROM Posts) AS TotalPosts,
    (SELECT COUNT(DISTINCT Posts.Id) 
     FROM Posts
     LEFT JOIN Comments ON Posts.Id = Comments.PostId
     WHERE Comments.Id IS NULL) AS PostsWithoutComments,
    CAST(100.0 * (SELECT COUNT(DISTINCT Posts.Id) 
                  FROM Posts 
                  LEFT JOIN Comments ON Posts.Id = Comments.PostId
                  WHERE Comments.Id IS NULL) / 
          (SELECT COUNT(*) FROM Posts) 
    AS DECIMAL(5, 2)) AS PercentageWithoutComments;

Enter Parameters

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