---用这个统计一类切开手术
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‘
--------------------------------------------------------------------------------------------------------------------------------------------