WITH TotalPosts AS ( SELECT COUNT(*) AS TotalPostCount FR...

0

Please login or register to vote for this query.

(click on this box to dismiss)

SharePoint Meta

Q&A about the site for SharePoint enthusiasts

WITH TotalPosts AS (
    SELECT COUNT(*) AS TotalPostCount
    FROM Posts
),
PostsWithComments AS (
    SELECT COUNT(DISTINCT PostId) AS PostsWithCommentCount
    FROM Comments
    WHERE PostId IS NOT NULL
)
SELECT 
    (TotalPosts.TotalPostCount - PostsWithComments.PostsWithCommentCount) * 100.0 / TotalPosts.TotalPostCount AS PercentageNoComments
FROM TotalPosts, PostsWithComments;

Enter Parameters

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