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

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

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

select
    tag,
    concat(round(round(avg(if(date_diff / duration>1,1,date_diff/duration)),4)*100,2),"%") avg_rate
    # concat(round(avg(if(date_diff / duration>1,1,date_diff/duration)),4)*100,"%") avg_rate
from
    (
        select
            g.video_id,
            timestampdiff (second, start_time, end_time) date_diff,
            tag,
            duration
        from
            tb_user_video_log g
            left join tb_video_info i on g.video_id = i.video_id
    ) a group by video_id
    having round(avg(date_diff / duration),2)*100>60
    order by avg_rate desc

#23届找工作求助阵地#
全部评论

相关推荐

害怕一个人的小黄鸭胖乎乎:笑死了,没有技术大牛,招一堆应届生,不到半年,代码就成屎山了
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务