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

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

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

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

全部评论

相关推荐

06-12 16:00
天津大学 Java
牛客30236098...:腾讯坏事做尽,终面挂是最破防的 上次被挂了后我连简历都不刷了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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