Home > database >  Pray god change red box of SQL statements to add
Pray god change red box of SQL statements to add

Time:10-01




Logic is clc_tb_screen suspicious symptoms is tuberculosis screening table
IS_COUGH is whether a cough, sputum acuity
2 weeksIS_HAVABLOOD is whether blood in phlegm or haemoptysis

Means if the patient cough is one at the same time, the blood in phlegm is once again together

CodePudding user response:

IS_COUGH and IS_HAVABLOOD query respectively, then the UNION ALL query results, and then grouping count,

CodePudding user response:

The select b.k ey, sum (case when conditions meet the end THEN 1 else 0 + 1 case the when condition 2 meet THEN one else 0 end)
From table 1 and table 2
The where condition
GROUP
  • Related