select a.date,round(sum(case a.type when'completed' then 0 else 1 end )*1.0/count(a.type),3)as pfrom (select e.send_id,e.receive_id,e.type,e.date,u1.is_blacklist as b1,u2.is_blacklist as b2 from email as ejoin user as u1on e.send_id=u1.id and u1.is_blacklist=0join user as u2on e.receive_id=u2.id and...