题解 | #各个视频的平均完播率#

各个视频的平均完播率

https://www.nowcoder.com/practice/96263162f69a48df9d84a93c71045753

Select b.video_id, 
FORMAT(sum(case when timestampdiff(second,start_time,end_time) >=duration then 1
else 0 end)/count(*),3) as avg_comp_play_rate
FROM tb_video_info a
join tb_user_video_log b ON a.video_id=b.video_id
WHERE year(start_time)='2021'
GROUP BY b.video_id
ORDER BY avg_comp_play_rate desc

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务