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

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

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

select
    tag,
    concat(round(avg(halfrate)*100, 2), '%') as avg_play_progress
from
    (
        select
            tag,
            if (
                timestampdiff (second, start_time, end_time) >= duration,
                1,
                timestampdiff (second, start_time, end_time)/duration
            ) as halfrate
        from
            tb_user_video_log
            join tb_video_info using (video_id)
    ) t1
group by
    tag
having
    avg(halfrate) > 0.6
order by
    avg_play_progress desc

难度不大,就是要知道在实例中 有一个旅游的观看占比只有60%需要去除

全部评论

相关推荐

05-05 21:45
已编辑
广州大学 Java
点赞 评论 收藏
分享
牛大宝儿236:还没入职就PUA,[发火我之前遇到一个月给500块钱的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务