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

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

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

select
    t1.tag,
    concat (round(t1.avg_play_progress * 100, 2), '%') avg_play_progress
from
    (
        select
            tag,
            avg(
                if (
                    TIMESTAMPDIFF (second, start_time,end_time) >= duration,
                    duration,
                    TIMESTAMPDIFF (second, start_time,end_time)
                ) / duration
            ) avg_play_progress
        from
            tb_video_info,
            tb_user_video_log
        where
            tb_video_info.video_id = tb_user_video_log.video_id
        group by
            tag
        having avg_play_progress>0.6
        order by
            avg_play_progress desc
    ) t1

全部评论

相关推荐

点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

更多
牛客网
牛客企业服务