当前位置:网站首页>SQL programming problem, test case failed
SQL programming problem, test case failed
2022-06-30 13:25:00 【CSDN Q & A】
Topic content
problem : Calculation 2021 The completion rate of each video recorded in the year ( The result is three decimal places ), And sort them in descending order according to the completion rate
notes : Video completion rate refers to the proportion of completed playback times to the total playback times . Simplicity , The difference between the end viewing time and the start playing time >= Video duration , It is deemed to have finished playing .
user - Video interactive table tb_user_video_log

Short video message table tb_video_info

Here is my code , No problem outputting use cases , But the test case fails , The test case fails all the time

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;
边栏推荐
- Publicity of the fourth batch of shortlisted Enterprises - annual Top100 smart Internet supplier selection
- jmeter 学习笔记
- Clearing TinyMCE rich text cache in elementui
- MySQL queries the data within the radius according to the longitude and latitude, and draws a circle to query the database
- Multi terminal collaboration of Huawei accounts to create a better internet life
- Ffmpeg miscellaneous
- 为基础性语言摇旗呐喊
- Postman génère automatiquement des fragments de code Curl
- mysql拒绝访问、管理员身份打开的
- Machine learning notes - Introduction to autocorrelation and partial autocorrelation
猜你喜欢

postman 自動生成 curl 代碼片段

这个编辑器即将开源!

写信宝小程序开源

华为帐号多端协同,打造美好互联生活

【精选】资源变现资讯、新闻、自媒体、博客小程序(可引流,开通流量主,带pc后台管理)

The independent station is Web3.0. The national "14th five year plan" requires enterprises to build digital websites!

QT read / write excel--qxlsx worksheet display / hide status setting 4

How to handle ZABBIX server startup failure

Read all the knowledge points about enterprise im in one article

WTM重大更新,多租户和单点登录
随机推荐
Postman génère automatiquement des fragments de code Curl
Dark horse notes - collection (common methods and traversal methods of collection)
Definition of variables and assignment of variables in MySQL
这个编辑器即将开源!
QT read / write excel--qxlsx worksheet display / hide status setting 4
ABAP toolbox v1.0 (with implementation ideas)
Waving flags and shouting for basic language
JMeter learning notes
Unity的脚本的基础语法(2)-Unity中记录时间
The independent station is Web3.0. The national "14th five year plan" requires enterprises to build digital websites!
常用的ui组件
正则系列之断言Assertions
ABAP工具箱 V1.0(附实现思路)
Dark horse notes -- wrapper class, regular expression, arrays class
Postman automatically generates curl code snippets
mysql拒绝访问、管理员身份打开的
MySQL queries the data within the radius according to the longitude and latitude, and draws a circle to query the database
知识传播不能取代专业学习!
Event handling in QT
逆向调试入门-PE中的VA与RVA换算04/07