select
a.date
,round(count(type)/a.r1,3)
from (
select
e.*
,count(type) over(partition by date) r1
from email e
join user u1
on e.send_id= u1.id
join user u2
on e.receive_id = u2.id
where u1.is_blacklist != 1
and u2.is_blacklist != 1
) a
where type = 'no_completed'
group by date