题解 | #平均播放进度大于60%的视频类别#

平均播放进度大于60%的视频类别

https://www.nowcoder.com/practice/c60242566ad94bc29959de0cdc6d95ef

select r.tag, CONCAT(ROUND(SUM(avg_play) / COUNT(tag) * 100, 2), '%') avg_play_progress from
(
select t2.tag,
if(TIMESTAMPDIFF(SECOND, start_time, end_time)/duration>1,1,TIMESTAMPDIFF(SECOND, start_time, end_time)/duration) avg_play
from tb_user_video_log t1
join tb_video_info t2
on t1.video_id=t2.video_id
) r 
group by r.tag having avg_play_progress >60
order by avg_play_progress desc

全部评论
点赞 回复 分享
发布于 06-19 10:07 北京

相关推荐

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