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

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

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

select ti.tag,
concat(round(avg(
    if(timestampdiff(second, tl.start_time, tl.end_time) > ti.duration, 100,
       timestampdiff(second, tl.start_time, tl.end_time) / ti.duration*100)
), 2),'%') as avg_play_progress
from tb_user_video_log as tl left join tb_video_info as ti
on tl.video_id=ti.video_id
group by ti.tag
having(avg(timestampdiff(second,tl.start_time,tl.end_time)/ti.duration)>0.6)
order by avg_play_progress desc


全部评论

相关推荐

政委qqq:这道题在算法竞赛里唯一考的就是高精度,但是只能难住C++这类语言,Python直接a+b秒天秒地
点赞 评论 收藏
分享
03-04 07:14
门头沟学院 C++
黑皮白袜臭脚体育生:老板:都给工作机会了还想要工资,哪来这么多好事
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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