BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: jackkawave ที่ มกราคม 12, 2010, 10:34:04 AM
-
ชื่อ - PID - สถานที่ทำงาน
........ขอบคุณครับ
-
ลองดูก่อนนะคะว่าใช้ได้ไหม
select v.vstdate,p.cid,p.hn,concat(p.pname,p.fname," ",p.lname) as tname,p.sex,v.age_y,
p.pttype,pt.name,h.name,d.licenseno,d.name
from vn_stat v
left outer join patient p on p.hn = v.hn
left outer join hospcode h on h.hospcode = v.hospmain
left outer join doctor d on d.code = v.dx_doctor
left outer join pttype pt on pt.pttype = v.pttype
where v.vstdate between '2009-12-01' and '2009-12-02'
and hospmain = '11082'
and v.pttype = '34'
-
select p.pname,p.fname,p.lname,ifnull(p.cid,p2.cardno) as cid,p.workaddr,p1.name as pttypename
from patient p
left join pttype p1 on p.pttype=p1.pttype
left join ptcardno p2 on p.hn=p2.hn and cardtype='01'
where p1.pcode='A7'
-
ขอบคุณมากครับ..................