sql group by

SELECT  dr_id
  
        ,ds
FROM    study
WHERE   ds <= 20210621
AND     ds > 20210520and     dr_id=193589;
查出结果是:8条记录
sql  group by

 

 用 group by   dr_id=193589,有8人

  

SELECT dr_id
,COUNT(DISTINCT ds) AS online_30d
FROM alihealth_dw.dwd_alihosp_dr_online_df
WHERE ds <= ‘20210621‘
AND ds > ‘20210520‘
AND is_online_1d = ‘Y‘
and dr_id=‘193589‘
GROUP BY dr_id;
sql  group by

 

 

 

sql group by

上一篇:Docker搭建mysql:5.7版本数据库


下一篇:JavaWeb3.1【MySQL约束:DQL查询语句】