ผู้เขียน หัวข้อ: ขอความช่วยเหลือเพิ่มชื่อ,เพศ,วดป/เกิด จากคำสั่งที่ส่งมาให้หน่อยครับ  (อ่าน 2787 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ chaiya_chaiyo

  • Newbie
  • *
  • กระทู้: 42
  • Respect: +1
    • ดูรายละเอียด
select  v.hn as HN,p.cardno as CID,o.icd10 as ICD10,pt.informname as N1,pt.informaddr as N2
from vn_stat v,ovstdiag o,visit_pttype vp,ptcardno p,patient pt
where v.vn=o.vn and v.vn=vp.vn and v.hn = pt.hn and vp.pttype="52"
and o.icd10 in ("Z021","Z027") and p.hn=v.hn
and v.vstdate between "2008-02-11" and "2008-02-11" group by v.hn
Mr.Panu Thipmud
โรงพยาบาลไชยา
อำเภอไชยา ตำบลตลาด จังหวัดสุราษฏร์ธานี
โทร 077-431466 ต่อ 107
โทร 087-8898-672
Hosxp Version 3.51.10.10
MySql Version 5.0

ออฟไลน์ BMS MA Team

  • Sr. Member
  • ****
  • กระทู้: 462
  • *TaK Ka TaN*
  • Respect: +1
    • ดูรายละเอียด
select  v.hn as HN,p.cardno as CID,o.icd10 as ICD10,pt.informname as N1,pt.informaddr as N2,
concat(pt.pname,pt.fname,"  ",pt.lname) as fullname,s.name as sex ,pt.birthday
from vn_stat v,ovstdiag o,visit_pttype vp,ptcardno p,patient pt
left outer join sex s on s.code=pt.sex
where v.vn=o.vn and v.vn=vp.vn and v.hn = pt.hn and vp.pttype="52"
and o.icd10 in ("Z021","Z027") and p.hn=v.hn
and v.vstdate between "2008-02-11" and "2008-02-11" group by v.hn
« แก้ไขครั้งสุดท้าย: มกราคม 26, 2009, 13:01:01 PM โดย phichit_admin »
- BMS Maintenance -

ออฟไลน์ thannawe

  • Hero Member
  • *****
  • กระทู้: 2,904
  • Respect: +8
    • ดูรายละเอียด
select  v.hn as HN,p.cardno as CID,o.icd10 as ICD10,pt.informname as N1,pt.informaddr as N2,
concat(pt.pname,pt.fname,"  ",pt.lname) as fullname,s.name as sex ,pt.birthday
from vn_stat v,ovstdiag o,visit_pttype vp,ptcardno p,patient pt
left outer join sex s on s.code=pt.sex
where v.vn=o.vn and v.vn=vp.vn and v.hn = pt.hn and vp.pttype="52"
and o.icd10 in ("Z021","Z027") and p.hn=v.hn
and v.vstdate between "2008-02-11" and "2008-02-11" group by v.hn

 ;) :D ;D :D ;) :D ;D ;D  สุดยอด !!!!!!!!
กิจจา ชาญธัญกรรม
นักวิชาการคอมพิวเตอร์ชำนาญการ รพ.โพธาราม จ.ราชบุรี
็HOSxP XE

ออฟไลน์ BMS MA Team

  • Sr. Member
  • ****
  • กระทู้: 462
  • *TaK Ka TaN*
  • Respect: +1
    • ดูรายละเอียด
select  v.hn as HN,p.cardno as CID,o.icd10 as ICD10,pt.informname as N1,pt.informaddr as N2,
concat(pt.pname,pt.fname,"  ",pt.lname) as fullname,s.name as sex ,pt.birthday
from vn_stat v,ovstdiag o,visit_pttype vp,ptcardno p,patient pt
left outer join sex s on s.code=pt.sex
where v.vn=o.vn and v.vn=vp.vn and v.hn = pt.hn and vp.pttype="52"
and o.icd10 in ("Z021","Z027") and p.hn=v.hn
and v.vstdate between "2008-02-11" and "2008-02-11" group by v.hn

 ;) :D ;D :D ;) :D ;D ;D  สุดยอด !!!!!!!!

อะไรคุณกิจ มีแฟนสวยแล้วไง ระวังแฟนคุณกิจไว้นะ ตั๊กจะแย่ง อิอิ  :-*
- BMS Maintenance -

ออฟไลน์ chaiya_chaiyo

  • Newbie
  • *
  • กระทู้: 42
  • Respect: +1
    • ดูรายละเอียด
ขอบคุณตั๊กมาก ๆเลยคับ น่ารักมาก ๆ คอยช่วยเหลือทุกอย่าง ขอบคุณจิง ๆๆๆๆๆ
Mr.Panu Thipmud
โรงพยาบาลไชยา
อำเภอไชยา ตำบลตลาด จังหวัดสุราษฏร์ธานี
โทร 077-431466 ต่อ 107
โทร 087-8898-672
Hosxp Version 3.51.10.10
MySql Version 5.0

ออฟไลน์ BMS MA Team

  • Sr. Member
  • ****
  • กระทู้: 462
  • *TaK Ka TaN*
  • Respect: +1
    • ดูรายละเอียด
ขอบคุณตั๊กมาก ๆเลยคับ น่ารักมาก ๆ คอยช่วยเหลือทุกอย่าง ขอบคุณจิง ๆๆๆๆๆ

โอ้โห !! พี่นุ กล่าวซะน้ำตาไหลเลย  :'(   ไม่ขนาดนั้นไม่ค่อยได้ช่วยอะไรพี่เลย บางทีไม่ค่อยรับโทรศัพท์พี่ด้วย
อิอิ  ;D
- BMS Maintenance -