zoukankan      html  css  js  c++  java
  • mysql语句

    1、mysql语句实现年龄分布
    select
    nnd as '年龄段',count(*) as '人数' from( select case when age>=1 and age<=10 then '1-10' when age>=11 and age<=20 then '11-20' when age>=21 and age<=30 then '21-30' when age>=31 and age<=40 then '31-40' when age>=41 and age<=50 then '41-50' when age>=51 and age<=60 then '51-60' when age>=61 and age<=70 then '61-70' when age>=71 and age<=80 then '71-80' when age>=81 and age<=90 then '81-90' when age>=91 and age<=100 then '91-100' ELSE '无年龄' end as nnd from doc_info )a group by nnd
    2、查找病历中包含逗号的诊断数量
    SELECT count(diag) FROM `doc_info_hive` where LOCATE(',',diag)>0  ;
    3、查找病例中不包含逗号的诊断数量
    SELECT count(diag) FROM `doc_info_hive` where LOCATE(',',diag)=0  ;
  • 相关阅读:
    连续奇数
    50:数根
    38:花生采摘
    素数对
    17:字符串判等
    2702:密码翻译
    27:单词翻转
    15:整理药名
    12:加密的病历单
    09:密码翻译
  • 原文地址:https://www.cnblogs.com/kwzblog/p/10191585.html
Copyright © 2011-2022 走看看