当前位置:网站首页>MySQL null value processing and value replacement
MySQL null value processing and value replacement
2022-07-07 04:24:00 【Data analysis of financial Xiaobai】
SELECT user_profile.device_id,user_profile.university,IFNULL(B.question,0),IFNULL(B.RIGHT_QUESTION,0) FROM user_profile LEFT JOIN (
SELECT device_id, COUNT(*) AS question,sum((case when result='right' then 1 else 0 end)) as RIGHT_QUESTION
FROM question_practice_detail WHERE month(date)=8 GROUP BY device_id)
AS B ON user_profile.device_id=B.device_id WHERE user_profile.university=" Fudan University "
Comprehensive operation
SELECT difficult_level,sum(ar)/count(*) AS RATE FROM
(
select IF(result="right",1,0) as ar,device_id,difficult_level FROM question_practice_detail LEFT JOIN question_detail
on question_practice_detail.question_id=question_detail.question_id
)
a
WHERE device_id IN (select device_id from user_profile where university=' Zhejiang University ')
GROUP BY difficult_level ORDER BY RATE
边栏推荐
- C # use Siemens S7 protocol to read and write PLC DB block
- [multi threading exercise] write a multi threading example of the producer consumer model.
- [leetcode]Spiral Matrix II
- What is CGI, IIS, and VPS "suggested collection"
- 这项15年前的「超前」技术设计,让CPU在AI推理中大放光彩
- UltraEdit-32 warm prompt: right association, cancel bak file [easy to understand]
- 2022中青杯数学建模B题开放三孩背景下的生育政策研究思路
- ABAP 動態內錶分組循環
- C#使用西门子S7 协议读写PLC DB块
- The root file system of buildreoot prompts "depmod:applt not found"
猜你喜欢
ABAP Dynamic Inner table Group cycle
Win11截图键无法使用怎么办?Win11截图键无法使用的解决方法
用头像模仿天狗食月
The root file system of buildreoot prompts "depmod:applt not found"
Ssm+jsp realizes the warehouse management system, and the interface is called an elegant interface
SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)
Digital chemical plant management system based on Virtual Simulation Technology
[on automation experience] the growth path of automated testing
C#使用西门子S7 协议读写PLC DB块
Quick completion guide of manipulator (10): accessible workspace
随机推荐
Redis源码学习(31),字典学习,dict.c(一)
Redis源码学习(30),字典学习,dict.h
Different meat customers joined hands with Dexter to launch different hamburgers in some stores across the country
Golang calculates constellations and signs based on birthdays
The first introduction of the most complete mongodb in history
[knife-4j quickly build swagger]
Mysql-数据丢失,分析binlog日志文件
C # use Siemens S7 protocol to read and write PLC DB block
[team learning] [phase 34] Baidu PaddlePaddle AI talent Creation Camp
杭州电 3711 Binary Number
Ssm+jsp realizes the warehouse management system, and the interface is called an elegant interface
The easycvr platform is connected to the RTMP protocol, and the interface call prompts how to solve the error of obtaining video recording?
Binary, octal, hexadecimal
Golang compresses and decompresses zip files
Some thoughts on cross end development of kbone and applet
高薪程序员&面试题精讲系列120之Redis集群原理你熟悉吗?如何保证Redis的高可用(上)?
Use br to back up tidb cluster to GCS
ABAP 動態內錶分組循環
Hangzhou Electric 3711 binary number
NanopiNEO使用开发过程记录