4. What percentage of posts have no comments attached to them?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

SELECT (CAST(Posts_NoComments AS float) / Num_Posts) * 100 AS Percentage
FROM (
SELECT COUNT(P.Id) AS Posts_NoComments
FROM Posts P
LEFT JOIN Comments C
ON C.PostId = P.Id
WHERE C.PostId = 0
) AS T1,
(
SELECT COUNT(P.ID) AS Num_Posts
FROM Posts P
) AS T2

Enter Parameters

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