ผู้เขียน หัวข้อ: ฝากอาจารย์อ๊อดช่วยด้วยครับ  (อ่าน 3012 ครั้ง)

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

ออฟไลน์ bangpahan

  • Newbie
  • *
  • กระทู้: 18
  • Respect: 0
    • ดูรายละเอียด
ฝากอาจารย์อ๊อดช่วยด้วยครับ
« เมื่อ: ตุลาคม 26, 2007, 14:27:48 PM »
0
select op.*,
concat(p.pname,p.fname,'  ',p.lname) as tname,d.name
from opitemrece op,patient p
left outer join drugitems d on d.icode = op.icode
where rxdate between '2006-12-01' and '2006-12-15'
and op.icode like '1460176'
and op.hn = p.hn
Bangpahan  Hospital  ,  Ayutthaya
___________________________________
Operating system    CentOS Linux 5.4
Kernel and CPU    Linux 2.6.18-164.el5 on x86_64
Memory    4.84 GB total
Processor information    Intel(R) Xeon(R) CPU X3330 @ 2.66GHz, 4 cores
MySQL   MySQL-percona-5.1.39-8.rhel5.x86_64
Implement    October 2004  By BMS

ออฟไลน์ SrWooD

  • Hero Member
  • *****
  • กระทู้: 1,024
  • Respect: +1
    • ดูรายละเอียด
Re: ฝากอาจารย์อ๊อดช่วยด้วยครับ
« ตอบกลับ #1 เมื่อ: ตุลาคม 26, 2007, 14:40:26 PM »
0
น่าจะเป็นแบบนี้นะครับ

select op.*,
concat(p.pname,p.fname,'  ',p.lname) as tname,d.name
from opitemrece op
left outer join patient p on op.hn=p.hn
left outer join drugitems d on d.icode = op.icode
where rxdate between '2006-12-01' and '2006-12-15'
and op.icode like '1460176'
and op.hn = p.hn

โรงพยาบาลโพธิ์ทอง จังหวัดอ่างทอง

ออฟไลน์ bangpahan

  • Newbie
  • *
  • กระทู้: 18
  • Respect: 0
    • ดูรายละเอียด
Re: ฝากอาจารย์อ๊อดช่วยด้วยครับ
« ตอบกลับ #2 เมื่อ: ตุลาคม 26, 2007, 14:59:49 PM »
0
ได้แล้วครับ
ขอบคุณครับพี่วุฒิ
Bangpahan  Hospital  ,  Ayutthaya
___________________________________
Operating system    CentOS Linux 5.4
Kernel and CPU    Linux 2.6.18-164.el5 on x86_64
Memory    4.84 GB total
Processor information    Intel(R) Xeon(R) CPU X3330 @ 2.66GHz, 4 cores
MySQL   MySQL-percona-5.1.39-8.rhel5.x86_64
Implement    October 2004  By BMS

doramon

  • บุคคลทั่วไป
Re: ฝากอาจารย์อ๊อดช่วยด้วยครับ
« ตอบกลับ #3 เมื่อ: ตุลาคม 26, 2007, 15:20:59 PM »
0
ขอบคุณมาก
เข้าเวปไม่ได้สองวันแล้ว