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

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

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

select t.tag,
       concat(cast(round(t.tmp_avg_play_progress*100,2) as char),'%') as avg_play_progress
from (
select c.tag,
       sum(if((c.time/c.duration)>=1,1,c.time/c.duration))/count(c.tag) as tmp_avg_play_progress
from
(select (unix_timestamp(a.end_time)-unix_timestamp(a.start_time)) as time,
        b.tag,
        b.duration
from tb_user_video_log a inner join tb_video_info b on a.video_id=b.video_id) c
group by c.tag) t
where t.tmp_avg_play_progress > 0.6
order by avg_play_progress desc

全部评论

相关推荐

03-11 23:33
已编辑
曲阜师范大学 后端工程师
牛客68808588...:果真开发过12306购票系统吗,这不是一眼就被看穿了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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