请选择 进入手机版 | 继续访问电脑版
设为首页收藏本站

jeesite

 找回密码
 注册新会员
查看: 277|回复: 1

体征数据统计

[复制链接]
admin 发表于 2018-7-11 17:22:52 | 显示全部楼层 |阅读模式
体征数据统计

  1. SELECT a.systolic_pressure AS "systolicPressure", a.diastolic_pressure AS "diastolicPressure",  a.blood_sugar AS "bloodSugar", a.water_quantity AS "waterQuantity", a.urine_output AS "urineOutput", a.weight  AS "weight",a.heart_rate AS "heartRate", a.create_date AS "createDate"
  2. FROM
  3. (SELECT  
  4. SUM(a.systolic_pressure) as systolic_pressure,
  5. SUM(a.diastolic_pressure) as diastolic_pressure ,
  6. SUM(a.blood_sugar) as blood_sugar ,
  7. SUM(a.water_quantity) as water_quantity ,
  8. SUM(a.urine_output)  as urine_output,
  9. SUM(a.weight) as weight ,
  10. SUM(a.heart_rate) as heart_rate ,
  11. DATE_FORMAT( a.create_date, "%Y-%m-%d" )  as create_date
  12. FROM maida_body_data a
  13. WHERE a.del_flag ='0' GROUP BY DATE_FORMAT( a.create_date, "%Y-%m-%d" )
  14. UNION
  15. SELECT  
  16. 0  AS "systolic_pressure",
  17. 0 AS "diastolic_pressure",
  18. 0 AS "blood_sugar",
  19. 0 AS "water_quantity",
  20. 0 AS "urine_output",
  21. 0 AS "weight",
  22. 0 AS "heart_rate",datelist AS create_date FROM calendar WHERE datelist BETWEEN  '2018-07-03' AND  '2018-07-11'

  23. ) a
  24. GROUP BY a.create_date
  25.                

  26.         
复制代码
回复

使用道具 举报

 楼主| admin 发表于 2018-7-11 17:40:34 | 显示全部楼层
  1. SELECT a.systolic_pressure AS "systolicPressure", a.diastolic_pressure AS "diastolicPressure",  a.blood_sugar AS "bloodSugar", a.water_quantity AS "waterQuantity", a.urine_output AS "urineOutput", a.weight  AS "weight",a.heart_rate AS "heartRate", a.create_date AS "createDate"
  2. FROM
  3. (SELECT  
  4. SUM(a.systolic_pressure) AS systolic_pressure,
  5. SUM(a.diastolic_pressure) AS diastolic_pressure ,
  6. SUM(a.blood_sugar) AS blood_sugar ,
  7. SUM(a.water_quantity) AS water_quantity ,
  8. SUM(a.urine_output)  AS urine_output,
  9. SUM(a.weight) AS weight ,
  10. SUM(a.heart_rate) AS heart_rate ,
  11. DATE_FORMAT( a.create_date, "%Y-%m-%d" )  AS create_date
  12. FROM maida_body_data a
  13. WHERE a.del_flag ='0' GROUP BY DATE_FORMAT( a.create_date, "%Y-%m-%d" )
  14. UNION
  15. SELECT  
  16. 0  AS "systolic_pressure",
  17. 0 AS "diastolic_pressure",
  18. 0 AS "blood_sugar",
  19. 0 AS "water_quantity",
  20. 0 AS "urine_output",
  21. 0 AS "weight",
  22. 0 AS "heart_rate",datelist AS create_date FROM calendar WHERE datelist BETWEEN  '2018-07-03' AND  '2018-07-11'

  23. ) a
  24. GROUP BY a.create_date
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册新会员

本版积分规则

QQ|手机版|小黑屋|Archiver|jeesite 官方论坛. ( 吉ICP备12004769号  

GMT+8, 2018-11-17 10:20 , Processed in 0.127930 second(s), 22 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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