摘要: 在工作中有各种需要求rate的场景,例如,某家商店一个月31天,开店了20天,所以开店率就是20/31. 通常,需要count(开店天数)/ count(总天数) 这样很麻烦 可以这样做,select avg(case when status='Open' then 1 else 0 end ) f 阅读全文
posted @ 2021-12-13 17:12 mickael1997 阅读(231) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示