题解 | #异常的邮件概率#
异常的邮件概率
https://www.nowcoder.com/practice/d6dd656483b545159d3aa89b4c26004e
select date,
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
on email.id=user.id
group by date
order by date
在my sql里跑出来都没问题,但是在牛客里跑报错,不知道怎么回事