query that will calculate the proportion of
no_count
provided.
SELECT *, no_count / (no_count + yes_count) AS no_count_ratio
FROM (
SELECT c.col1,c.col2
, count(u.terms='A' AND u.space='R' OR NULL) AS yes_count
, count(u.terms='C' AND u.space='R' OR NULL) AS no_count
FROM schema1.table1 u
JOIN schema1.table2 cu USING (tale2id)
JOIN schema1.table3 c USING (oneid)
WHERE cu.created_date > now() - interval '5 days'
GROUP BY 1,2
) sub;
WHERE .... -- to select specific rows ...
Assuming the total consists of "yes" and no" and no other options.
If you want "percentage" multiply by 100.
I put your main query into a subquery to make it easier, simplified the syntax a bit, but didn't change anything. Only added no_count_ratio
to the outer query.