当前位置:网站首页>SQL编程问题,测试用例不通过
SQL编程问题,测试用例不通过
2022-06-30 12:47:00 【CSDN问答】
题目内容
问题:计算2021年里有播放记录的每个视频的完播率(结果保留三位小数),并按完播率降序排序
注:视频完播率是指完成播放次数占总播放次数的比例。简单起见,结束观看时间与开始播放时间的差>=视频时长时,视为完成播放。
用户-视频互动表tb_user_video_log
短视频信息表tb_video_info
下面是我的代码,输出用例没问题,但是测试用例不通过,一直测试用例不通过
SELECT
video_id,
round(avg(CASE WHEN SECOND(TIMEDIFF(end_time, start_time)) >= duration THEN 1
ELSE 0
END),3) avg_comp_play_rate
FROM
tb_user_video_log
JOIN
tb_video_info USING (video_id)
WHERE
YEAR(start_time) = 2021 and YEAR(end_time) = 2021
GROUP BY video_id
ORDER BY avg_comp_play_rate DESC;
边栏推荐
- Data Lake (11): Iceberg table data organization and query
- Basic syntax of unity script (1) - common operations of game objects
- golang 基础 —— 字符串 与 int 、int64 互转
- 防火墙基础之总部双机热备与分支基础配置
- [learn awk in one day] operator
- Motor control Clarke( α/β) Derivation of equal amplitude transformation
- How to handle ZABBIX server startup failure
- Js根据相同值将数组转换为二维数组
- Unity脚本的基础语法(5)-向量
- 我如何才能保护我的私钥?
猜你喜欢
我如何才能保护我的私钥?
黑马笔记---常用日期API
RK356x U-Boot研究所(命令篇)3.3 env相关命令的用法
你想要的异常知识点都在这里了
逆向调试入门-PE中的VA与RVA换算04/07
The independent station is Web3.0. The national "14th five year plan" requires enterprises to build digital websites!
【C】深入理解指针、回调函数(介绍模拟qsort)
Data Lake (11): Iceberg table data organization and query
【精选】资源变现资讯、新闻、自媒体、博客小程序(可引流,开通流量主,带pc后台管理)
顺应媒体融合趋势,中科闻歌携手美摄打造数智媒宣
随机推荐
Qt中的事件处理
【招聘(广州)】成功易(广州).Net Core中高级开发工程师
Illustration creating a stored procedure using Navicat for MySQL
postman 自动生成 curl 代码片段
发生QQ大规模盗号事件,暴露出什么网络安全问题?
力扣之螺旋矩阵,一起旋转起来(都能看懂)
你想要的异常知识点都在这里了
How can c write an SQL parser
电机控制park变换公式推导
Today's sleep quality record 80 points
Solve numpy core._ exceptions. Ufunctypeerror: UFUNC 'Add' did not contain a loop with signature matching
Common UI components
An interesting thing happened in the project
Problems and analysis in JMeter performance testing. How many problems have you encountered?
jmeter 学习笔记
uniapp支付之APP微信支付unicloud版(附源码)
Write, append, read, and copy of golang files: examples of using bufio packages
SQL考勤统计月报表
elementui中清除tinymce富文本缓存
写信宝小程序开源