摘要: select DBP_Sec+0 as ID ,ELT( INTERVAL (DBP_sec, 1, 2, 3, 4,5,6,7,8,9,10,11), "0-50", "50-60", "60-70", "70-80", "80-90", "90-100", "100-110", "110-120 阅读全文
posted @ 2020-07-09 18:57 LuckyKun的羊肉 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 采集方式有KRK和YD 将YD的数据和KRK的放在 一列,但是可能YD有两条,那么如何选择YD最新的一条和KRK结合起来呢?先筛选后横转纵 -- KRK 和YD组合到一起 select PatientID , Age, Sex, Height, Weight,OperatorID,BMI, max( 阅读全文
posted @ 2020-07-09 18:54 LuckyKun的羊肉 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 横转纵直接就用case when ,对于数值类的可以添加个聚合函数,那么文本类的也可以添加聚合函数吗? select PatientID , Age, Sex, Height, Weight,OperatorID,BMI, max(case when rank%2=1 then KRKPPGFile 阅读全文
posted @ 2020-07-09 18:49 LuckyKun的羊肉 阅读(189) 评论(0) 推荐(0) 编辑
摘要: MYSQL中没有row_number()over(partition by order by ),如何排序后进行筛选? 方法一: select OperatorID,sum(cnt) as '总人数',sum(case when Quality=1 then cnt else 0 end ) as 阅读全文
posted @ 2020-07-09 18:45 LuckyKun的羊肉 阅读(409) 评论(0) 推荐(0) 编辑
摘要: SELECT p.PatientID ,p.SBP, p.SBP2,p.SBP-p.SBP2 FROM ppg_data AS p where p.SBP2 is not null and p.SBP is not null 更改为 SELECT p.PatientID ,p.SBP, p.SBP2 阅读全文
posted @ 2020-07-09 18:32 LuckyKun的羊肉 阅读(1446) 评论(0) 推荐(0) 编辑