个人测试
文章目录
select tt.school,
count(tt.id) astoBeScreenCount,
count(tt.screen_tag = '1' or null) as screenedCount,
count(tt.symptom_tag = '1' or null) as symptomCount,
count(tt.tst_exam_tag = '1' or null) as tstExamCount,
count(tt.tst_strong_positive_tag = '1' or null) as tstStrongPositiveCount,
count(tt.igra_exam_tag = '1' or null) as igraExamCount,
count(tt.igra_strong_positive_tag = '1' or null) as igraStrongPositiveCount,
count(tt.id) as chestExamCount,
count(tt.chest_exam_tag = '1' or null) as chestExamRealCount,
count(tt.diagnosis_tag = '1' or null) as diagnoseTbCount,
count(tt.infect_tag = '1' or null) as tbInfectCount,
count(tt.tb_receive_treatment_tag = '1' or null) as tbInfectTreatedCount,
count(tt.complete_treat_tag = '1' or null) as completeTbTreatCount,
CASE
WHEN age > 15 THEN
1
ELSE
2
END as agegroup
from t_tb tt
where tt.people_type = '0'
GROUP BY CASE
WHEN age > 15 THEN
1
ELSE
2
END,school ORDER BY school;测试 哈哈哈 我好像会使用了哦
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论