WITH CTE1 AS ( SELECT DISTINCT COUNT(U.id) AS count_pos...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Skeptics

Q&A for scientific skepticism

--SELECT ROUND((SELECT DISTINCT COUNT(U.id) FROM USERS U
--LEFT JOIN POSTS P
--ON U.Id = P.OwnerUserId WHERE U.id >= -1 and P.Id is NULL) / (SELECT count(id) FROM USERS), 2) * 100 AS RESULT;


WITH CTE1 AS (
SELECT DISTINCT COUNT(U.id) AS count_post
FROM USERS U
LEFT JOIN POSTS P
ON U.Id = P.OwnerUserId WHERE U.id >= -1 and P.Id is NULL
),
CTE2 AS (
SELECT count(id) AS count_nopost
FROM USERS
)
SELECT (100 * CTE1.count_post / CTE2.count_nopost)
FROM CTE1, CTE2

Enter Parameters

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