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

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

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

select 
	tag,
	avg_play_progress
from
(
select
	tag,
	concat(round(avg(
	case
		when process >= 1 then 1
		else process
	end 
	)*100,2), '%') avg_play_progress
	
from
	(
	select
		t2.tag,
		(TIMESTAMPDIFF(second,t1.start_time,t1.end_time)/t2.duration)  process
	from
		tb_user_video_log t1 ,
		tb_video_info t2
	where
		t1.video_id = t2.video_id
	) xxx 
group by tag 
) xxxx 
where cast((left(avg_play_progress,5)) as decimal(5,2)) > 60
order by avg_play_progress desc

全部评论

相关推荐

04-29 22:35
门头沟学院 Java
牛友说改了名字能收到offer:旧图新发查看图片
点赞 评论 收藏
分享
04-25 19:29
已编辑
宁波大学 运营
被普调的六边形战士很高大:你我美牛孩
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务