ลองเล่น Mysql ครับ
DateTime : 2010-02-26 16:24:32
Post By : wauy
IP Address :
select op.hn,concat(p.pname,p.fname,' ',p.lname) as ptname,op.rxdate,n.name as nondrugitems,t.name as pttypename
from opitemrece op
left outer join patient p on p.hn=op.hn
left outer join nondrugitems n on n.icode=op.icode
left outer join pttype t on t.pttype=op.pttype
where op.icode in ("3000681","3000706","3330780") and op.rxdate between "2008-10-01" and "2009-09-30" and t.pcode in ("AA","AB","AC","AD","AE","AF","AG","AJ","AK","UC","UB","UA")
order by rxdate
Message !!
หากต้องการตอบกระทู้ Webboard กรุณาเข้าใช้ระบบก่อนนะค่ะ..
กระทู้ตอบกลับ
select o.request_date,o.hn,o.vn,o.an,o.patient_department,o.provision_diagnosis,o.operation_name,
concat(pt.pname,pt.fname,' ',pt.lname) as ptname,s.status_name,
e.emergency_name,i.name as provision_name ,d.name as request_doctor_name ,
ot.name as operation_type_name,type.pcode,type.name,t.pttype
from operation_list o
left outer join patient pt on pt.hn=o.hn
left outer join ipt t on t.an = o.an
left outer join pttype type on type.pttype=t.pttype
left outer join operation_status s on s.status_id=o.status_id
left outer join operation_emergency e on e.emergency_id=o.emergency_id
left outer join operation_screen_in oi on oi.operation_id = o.operation_id
left outer join icd101 i on i.code=substring(o.provision_diagnosis,1,3)
left outer join doctor d on d.code=o.request_doctor
left outer join spclty sp on sp.spclty = o.spclty
left outer join operation_type ot on ot.operation_type_id = o.operation_type_id
where o.request_operation_date between '2008-10-01' and '2009-09-30' and o.status_id = 3 and o.operation_type_id = 1 and type.pcode in ("AA","AB","AC","AD","AE","AF","AG","AJ","AK","UC","UB","UA")
order by o.request_date
Post โดย : wauy Date: 2010-02-26 16:25:33 ip:
select pm.*,concat(pt.pname,pt.fname," ",pt.lname) as ptname,pt.cid,py.pttype,py.name
from physic_main pm,patient pt,pttype py
where pm.hn=pt.hn and pt.pttype=py.pttype and pm.vstdate between '2009-11-01' and '2009-11-31'
อิอิอิ..55555...ของเล่นแก้เหงาครับ
Post โดย : wauy Date: 2010-02-26 16:27:21 ip:
select i.hn,i.refer_out_number,i.an,i.regdate,i.regtime,i.ward,ia.bedno ,l.infant_weight,
l.infant_sex in(1='ªÒÂ',2='ËÔ§'),
concat(p.pname,p.fname,' ',p.lname) as ptname , a.age_y,
i.pttype ,pty.name as pttype_name,pg.labor_date,it.name as deliver_type_name ,
w.name as ward_name , pg.ga,pg.child_count,
pg.anc_complete ,l.infant_apgarscore1,l.infant_apgarscore5,l.infant_apgarscore10 ,
d.name as labor_doctor_name ,l.infant_weight,l.infant_length ,
concat(il.g,'-',il.t,'-', il.p,'-',il.a,'-',il.l) as gpal ,l.mother_hct ,
i.prediag, a.pdx ,ic.name as main_pdx_name ,l.labour_finishtime ,
concat(p.addrpart,' Á.',p.moopart,' ',t.full_name) as address_name , ro.docno as refer_out_docno
from ipt i
left outer join iptadm ia on ia.an=i.an
left outer join patient p on p.hn=i.hn
left outer join an_stat a on a.an=i.an
left outer join pttype pty on pty.pttype=i.pttype
left outer join ward w on w.ward = i.ward
left outer join ipt_pregnancy pg on pg.an = i.an
left outer join ipt_pregnancy_deliver_type it on it.id = pg.deliver_type
left outer join labor l on l.an = i.an
left outer join ipt_labour il on il.an = i.an
left outer join doctor d on d.code = l.labor_who
left outer join icd101 ic on ic.code = a.pdx
left outer join thaiaddress t on t.addressid = a.aid
left outer join referout ro on ro.vn = i.an
where i.ipt_type=4 and i.an in (select an from labor ) and pg.labor_date
between '2009-08-01' and '2009-08-31'
order by pg.labor_date asc
Post โดย : wauy Date: 2010-02-26 16:30:01 ip:
ลองดูครับพี่น้องเผื่อนำไปใช้ได้ครับ
Post โดย : wauy Date: 2010-02-26 16:31:08 ip:
เดี๋ยวหามาให้เล่นใหม่นะครับพี่น้อง
ไปงานเลี้ยงก่อนครับ
Post โดย : wauy Date: 2010-02-26 16:41:13 ip:
hospital profile
Post โดย : wauy Date: 2010-03-01 14:25:53 ip:
บางตัวได้ บางตัวว่างอะพี่ แจ่มมาก...
Post โดย : huwko Date: 2010-03-02 09:26:51 ip:
ต้องเข้าไปดูตามเงื่อนไขของโรงพยาบาลเราครับ
ว่าเรากำหนดสิทธิยังไงครับ เพิ่มเติมนิดนึงครับ
พี่น้อง
Post โดย : wauy Date: 2010-03-03 11:00:36 ip:
เอาไปแก้เล่นๆเลยครับ
แก้เหงา อิอิอิ...55555
Post โดย : wauy Date: 2010-03-03 17:34:37 ip: