select date, count(distinct case when type='completed' then email.id else null end )as success, count(distinct case when type='no_completed' then email.id else null end )as fail, round(count(distinct case when type='no_completed' then email.id else null end )/ count(distinct case when type='completed' then email.id else null end ) ,3)as p from email left join user u1 on email.send_id=u1.id and u1.is_blacklist=0 left join user u2 on email.receive_id=u2.id and u2.is_blacklist=0 group by date order by date; MySQL里运行是的 但是牛客网上报错 我觉得没错啊
点赞

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务