ผู้เขียน หัวข้อ: รบกวนด้วยครับแก้ไขอย่างไรครับ  (อ่าน 2311 ครั้ง)

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

ออฟไลน์ SV_Phichit

  • Sr. Member
  • ****
  • กระทู้: 439
  • ..สุข..หรือ..ทุกข์..อยู่ที่ใจเรา..
  • Respect: +2
    • ดูรายละเอียด
    • โรงพยาบาลสหเวช พิจิตร
รบกวนด้วยครับแก้ไขอย่างไรครับ
« เมื่อ: สิงหาคม 01, 2010, 12:15:11 PM »
0
รบกวนด้วยครับแก้ไขอย่างไรครับ
จะแทรก ขนาดฟิล์มที่ใช้กับคนไข้นะครับ

select staff,x.xn,x.hn,x.request_date,x.request_time,x.report_date,x.report_time,x.doctor,x.xray_type,
concat(p.pname," ",p.fname,"  ",p.lname) as ptname ,  d.name as doctor_name  ,
d2.name as request_doctor_name ,  t.name as xray_type_name ,x.vn,x.an  ,v.age_y,
 xi.* , rx.xn as real_xn
 from xray_report x
 left outer join patient p on p.hn=x.hn
 left outer join doctor d on d.code=x.doctor
 left outer join doctor d2 on d2.code=x.request_doctor
 left outer join xray_type t on t.xray_type = x.xray_type
 left outer join xray_items xi on xi.xray_items_code=x.xray_items_code
 left outer join vn_stat v on v.vn=x.vn
 left outer join xrayxn rx on rx.hn=x.hn

 and rx.regdate between "2010-07-31" and "2010-07-31"
 where ( x.request_date between "2010-07-31" and "2010-07-31")
 and x.xray_items_code not in (0)
 and (x.confirm="Y")
::SAHAVEJ PHICHIT HOSPITAL::
http://www.sahavej.com/sahavejweb/indexx.html
ขึ้นระบบเมื่อ 1 ตุลาคม 2552
SERVER :   Linux Centos 5.3 X86 64B IT Ram 4 G
BackUp1 :  Linux Centos 5.3 X86 64B IT Ram 4 G
BackUp2 :  Linux Centos 5.3 X86 64B IT Ram 2 G
HOSxP Version : 3.54.7.20
MySQL Version : 5.1.30
Client : Windows Xp & Windows Vista  30 เครื่อง
-------------------------------------------------
E-mail : matrix_juster@hotmail.com
-------------------------------------------------

ออฟไลน์ Khuad

  • Hero Member
  • *****
  • กระทู้: 3,778
  • .. นางฟ้า ตัวไม่น้อยแล้ว ..
  • Respect: +10
    • ดูรายละเอียด
Re: รบกวนด้วยครับแก้ไขอย่างไรครับ
« ตอบกลับ #1 เมื่อ: สิงหาคม 01, 2010, 23:48:21 PM »
0
select staff,x.xn,x.hn,x.request_date,x.request_time,x.report_date,x.report_time,x.doctor,x.xray_type,
concat(p.pname," ",p.fname,"  ",p.lname) as ptname ,  d.name as doctor_name  ,
d2.name as request_doctor_name ,  t.name as xray_type_name ,x.vn,x.an  ,v.age_y,
xi.* , rx.xn as real_xn

,xf.film_name as "ขนาด Film ที่ใช้",xrf.qty as "จำนวน Film ที่ใช้",xd.damage_name as "สาเหตุ กรณี Film เสีย"

from xray_report x
left outer join patient p on p.hn=x.hn
left outer join doctor d on d.code=x.doctor
left outer join doctor d2 on d2.code=x.request_doctor
left outer join xray_type t on t.xray_type = x.xray_type
left outer join xray_items xi on xi.xray_items_code=x.xray_items_code
left outer join vn_stat v on v.vn=x.vn

left outer join xray_report_film xrf on xrf.xn = x.xn
left outer join xray_film xf on xf.film_id = xrf.film_id
left outer join xray_damage xd on xd.damage_id = xrf.damage_id


left outer join xrayxn rx on rx.hn=x.hn

and rx.regdate between "2008-01-11" and "2008-01-11"
where ( x.request_date between "2008-01-11" and "2008-01-11")
and x.xray_items_code not in (0)
and (x.confirm="Y")

... น่าจะพอใช้ได้นะครับ ...  :D ...

โรงพยาบาลวังน้อย   พระนครศรีอยุธยา ( รพช.30 เตียง )
Server : ProLiant DL120G6  Xeon X3450  RDIMM 12 Gb  2x256GB SSD Raid 1
OS : CentOS 6.3  DB : Percona 5.5.21

Slave : ProLiant ML110G6  Xeon X3430  UDIMM 8 Gb  2x300GB SAS Raid 1
OS : CentOS 6.3  DB : Percona 5.5.32

HOSxP version  3.57.xx.xx    เริ่มระบบ  เมษายน 2549