切换到窄版

Good技术分享

 找回密码
 立即注册
搜索
热搜: 活动 交友
查看: 149|回复: 0

[【工作记录】] 统计规则数量与新增和修改规则数量

[复制链接]
发表于 2025-1-10 14:16:02 | 显示全部楼层 |阅读模式
统计规则数量:
  1. select sum(c) from (
  2. select count(0)c from pdss.hospital_drug_dosage union all
  3. select count(0)c from pdss.hospital_indication union all
  4. select count(0)c from pdss.hospital_caution union all
  5. select count(0)c from pdss.hospital_interaction union all
  6. select count(0)c from pdss.hospital_drug_repeat union all
  7. select count(0)c from pdss.hospital_incompatibility_multi union all
  8. select count(0)c from pdss.hospital_contraindication union all
  9. select count(0)c from pdss.hospital_dosage_advanced union all


  10. select count(0)c from inppdss.hospital_drug_dosage union all
  11. select count(0)c from inppdss.hospital_indication union all
  12. select count(0)c from inppdss.hospital_caution union all
  13. select count(0)c from inppdss.hospital_interaction union all
  14. select count(0)c from inppdss.hospital_drug_repeat union all
  15. select count(0)c from inppdss.hospital_incompatibility_multi union all
  16. select count(0)c from inppdss.hospital_contraindication union all
  17. select count(0)c from inppdss.hospital_dosage_advanced);
复制代码
—统计修改和新增的规则数量:
  1. select sum(c),b from (
  2. select count(0)c,substr(t.modify_time,0,7)b from pdss.hospital_drug_dosage_history  t group by substr(t.modify_time,0,7) union all
  3. select count(0)c,substr(t.modify_time,0,7)b from pdss.hospital_drug_repeat_history  t group by substr(t.modify_time,0,7) union all
  4. select count(0)c,substr(t.modify_time,0,7)b from pdss.hospital_indication_history  t group by substr(t.modify_time,0,7) union all
  5. select count(0)c,substr(t.modify_time,0,7)b from pdss.hospital_caution_history  t group by substr(t.modify_time,0,7) union all
  6. select count(0)c,substr(t.modify_time,0,7)b from pdss.hospital_interaction_history  t group by substr(t.modify_time,0,7) union all
  7. select count(0)c,substr(t.modify_time,0,7)b from pdss.HOSPITAL_INCOMPATIMULTI_HIS  t group by substr(t.modify_time,0,7) union all
  8. select count(0)c,substr(t.modify_time,0,7)b from pdss.hospital_dosage_advanced_his t group by substr(t.modify_time,0,7) union all
  9. select count(0)c,substr(t.create_time,0,7)b from pdss.hospital_drug_dosage  t group by substr(t.create_time,0,7) union all
  10. select count(0)c,substr(t.create_time,0,7)b from pdss.hospital_drug_repeat  t group by substr(t.create_time,0,7) union all
  11. select count(0)c,substr(t.create_time,0,7)b from pdss.hospital_indication  t group by substr(t.create_time,0,7) union all
  12. select count(0)c,substr(t.create_time,0,7)b from pdss.hospital_caution  t group by substr(t.create_time,0,7) union all
  13. select count(0)c,substr(t.create_time,0,7)b from pdss.hospital_interaction  t group by substr(t.create_time,0,7) union all
  14. select count(0)c,substr(t.create_time,0,7)b from pdss.hospital_dosage_advanced t group by substr(t.create_time,0,7)) where b>'2022-10' and  b<'2023-11' group by b;
复制代码


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


QQ|手机版|小黑屋|Good技术分享

GMT+8, 2025-2-5 18:44 .

www.52yfw.com

Technology sharing

快速回复 返回顶部 返回列表