当前位置:网站首页>How does SQLite count the data that meets another condition under the data that has been classified once
How does SQLite count the data that meets another condition under the data that has been classified once
2022-07-06 14:25:00 【CSDN Q & A】
Data is a bunch of information about children , I'll count them by race first , Then I will count the number of sick children in each race .
Problem situation :
I think there is something wrong with the red line above me , But after trying for a long time, I don't know what's wrong .
I hope to achieve the effect like the following , Connect the two columns , Then calculate the ratio .
I hope some students can help solve it , thank you !
Take the answer :
This problem can be solved by case when Write for processing , The specific implementation can refer to the following code :
select Ethnicity,sum(case when [Class/ASDTraits] = "Yes" then 1 else 0 end ) -- Number of sick children ,count(*) -- The number of children of all ethnic groups ,sum(case when [Class/ASDTraits] = "Yes" then 1 else 0 end ) /count(*) --- Prevalence rate from ASDgroup by Ethnicity
边栏推荐
- Detailed explanation of network foundation routing
- Hackmyvm target series (4) -vulny
- Network technology related topics
- Mixlab unbounded community white paper officially released
- Applet Web Capture -fiddler
- New version of postman flows [introductory teaching chapter 01 send request]
- 《统计学》第八版贾俊平第十四章指数知识点总结及课后习题答案
- Renforcer les dossiers de base de l'apprentissage
- 7-9 make house number 3.0 (PTA program design)
- Hackmyvm target series (2) -warrior
猜你喜欢
随机推荐
《统计学》第八版贾俊平第十三章时间序列分析和预测知识点总结及课后习题答案
Markdown font color editing teaching
7-11 mechanic mustadio (PTA program design)
Data mining - a discussion on sample imbalance in classification problems
Experiment 4 array
Sword finger offer 23 - print binary tree from top to bottom
AQS details
《英特尔 oneAPI—打开异构新纪元》
Spot gold prices rose amid volatility, and the rise in U.S. prices is likely to become the key to the future
外网打点(信息收集)
浅谈漏洞发现思路
网络基础详解
Hackmyvm target series (2) -warrior
内网渗透之内网信息收集(二)
HackMyvm靶机系列(2)-warrior
7-6 local minimum of matrix (PTA program design)
Uibutton status exploration and customization
[VMware abnormal problems] problem analysis & Solutions
Renforcer les dossiers de base de l'apprentissage
xray与burp联动 挖掘