当前位置:Gxlcms > 数据库问题 > sql语句

sql语句

时间:2021-07-01 10:21:17 帮助过:2人阅读

技术分享图片

---用这个统计一类切开手术
select distinct a.brbh as 患者病历号,a.brxb as 性别,a.rynl as 年龄,a.ryrq as 入院日期,a.cyrq as 出院日期 ,
(select count(distinct emr_yzb.yfyy) from emr_yzb where emr_yzb.zyh=a.jzhm ) as 是否预防0为否大于0为是,
c.pz as 品种,
c.lc as 疗程
from ys_zy_jzjl a,sm_sssq b,v_amqc_kjyw_lc c,gy_ssdm d
where a.jzhm=b.zyh
and a.jzhm=c.zyh
and b.tjbz=1
and b.apbz=1
and b.zfbz=0
and a.cyrq>to_date(‘2014-05-01 00:00:00‘,‘yyyy-mm-dd hh24:mi;ss‘)
and a.cyrq<to_date(‘2014-05-31 23:59:59‘,‘yyyy-mm-dd hh24:mi;ss‘)
and b.ssnm = d.ssnm and substr(ssdm,0,5) >‘53.0‘ and substr(ssdm,0,5) <‘53.1‘

--------------------------------------------------------------------------------------------------------------------------------------------

sql语句

标签:tin   bst   image   sql   品种   日期   img   logs   class   

人气教程排行