当前位置:网站首页>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
边栏推荐
- Zero knowledge private application platform aleo (1) what is aleo
- 【OA】Excel 文档生成器: Openpyxl 模块
- 如何编写一个程序猿另一个面试官眼前一亮的简历[通俗易懂]
- leetcode 53. Maximum Subarray 最大子数组和(中等)
- MySQL data loss, analyze binlog log file
- 机器人(自动化)课程的持续学习-2022-
- Restore backup data on GCS with tidb lightning
- EasyUI export excel cannot download the method that the box pops up
- ABAP dynamic inner table grouping cycle
- easyui出口excel无法下载框弹出的办法来解决
猜你喜欢
Class constant pool and runtime constant pool
The most complete learning rate adjustment strategy in history LR_ scheduler
各路行业大佬称赞的跨架构开发“神器”,你get同款了吗?
【写给初发论文的人】撰写综述性科技论文常见问题
Mysql-数据丢失,分析binlog日志文件
Quick completion guide of manipulator (10): accessible workspace
ABAP Dynamic Inner table Group cycle
Some thoughts on cross end development of kbone and applet
Video fusion cloud platform easycvr video Plaza left column list style optimization
DAB-DETR: DYNAMIC ANCHOR BOXES ARE BETTER QUERIES FOR DETR翻译
随机推荐
C # use Siemens S7 protocol to read and write PLC DB block
Kotlin compose text supports two colors
PHP 实现根据概率抽奖
Learn how to use js to merge two objects into one object assign()
高薪程序员&面试题精讲系列120之Redis集群原理你熟悉吗?如何保证Redis的高可用(上)?
视频融合云平台EasyCVR视频广场左侧栏列表样式优化
Unity3d can change colors and display samples in a building GL material
MySQL data loss, analyze binlog log file
Highly paid programmers & interview questions. Are you familiar with the redis cluster principle of series 120? How to ensure the high availability of redis (Part 1)?
POJ training plan 2253_ Frogger (shortest /floyd)
案例大赏:英特尔携众多合作伙伴推动多领域AI产业创新发展
The most complete security certification of mongodb in history
Win11控制面板快捷键 Win11打开控制面板的多种方法
[record of question brushing] 2 Add two numbers
Unity3D在一建筑GL材料可以改变颜色和显示样本
How to write a resume that shines in front of another interviewer [easy to understand]
[untitled]
ABAP 动态内表分组循环
[ArcGIS tutorial] thematic map production - population density distribution map - population density analysis
用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30