ติ๊กในฐานข้อมูลว่าเป็นยา antibiotic ตามรูปเลยครับ ไม่ต้องอาศัย icode
ติ๊กในฐานข้อมูลว่าเป็นยา antibiotic ตามรูปเลยครับ ไม่ต้องอาศัย icode
ติ๊กในฐานข้อมูลว่าเป็นยา antibiotic ตามรูปเลยครับ ไม่ต้องอาศัย icodeติ๊กในฐานข้อมูลว่าเป็นยา antibiotic ตามรูปเลยครับ ไม่ต้องอาศัย icode
ตามรูป อ.โก้ กล่าวเลยครับ รายงานจะเช็คว่าอย่างตัวไหนเป็น antibiotic บ้างจากวิธีการที่ อ.โก็แสดงครับ แล้วจะดึงออกมาตาราง opitemrece ตามคำสั่ง
select d.name,sum(o.qty) as qty,sum(o.qty)*d.unitcost as unitprice,sum(sum_price)as price from opitemrece o
inner join drugitems d on d.icode=o.icode
where o.vstdate between "2009-10-01" and "2009-10-31" and d.antibiotic="Y"
group by o.icode
order by qty desc
ถ้าเราต้องการจะรู้ว่าโรคตัวไหนที่ใช้ยาในกลุ่ม Antibiotic ล่ะครับจะต้องเพิ่มลงตรงไหนคับ
ขอความกรุณาท่านอาจาร์ยทั้งหลายช่วยด้วยครับ
:D
ถ้าเราต้องการจะรู้ว่าโรคตัวไหนที่ใช้ยาในกลุ่ม Antibiotic ล่ะครับจะต้องเพิ่มลงตรงไหนคับ
ขอความกรุณาท่านอาจาร์ยทั้งหลายช่วยด้วยครับ
:D
ลองใช้คำสั่งนี้ดูครับโค๊ด: Delphi
select v.icd10, i.name from ovstdiag v left outer join opitemrece o on o.vn=v.vn left outer join drugitems d on d.icode=o.icode left outer join icd101 i on i.code=v.icd10 where v.vstdate between "2011-01-01" and "2011-01-05" and d.antibiotic="Y" group by v.pdx
1.
select concat(p.pname,p.fname," ",p.lname) as pat,p.hn,vn.vstdate,v.icd10, i.name
2.
from ovstdiag v
left outer join vn_stat vn on vn.vn=v.vn
left outer join patient p on p.hn=vn.hn
3.
left outer join opitemrece o on o.vn=v.vn
4.
left outer join drugitems d on d.icode=o.icode
5.
left outer join icd101 i on i.code=v.icd10
6.
where v.vstdate between "2011-01-01" and "2011-01-05"
7.
and d.antibiotic="Y"
8.
group by v.vn
ต้องลองดูก่อนครับ สัก ช่วงวันน้อย ๆ
ติ๊กในฐานข้อมูลว่าเป็นยา antibiotic ตามรูปเลยครับ ไม่ต้องอาศัย icodeติ๊กในฐานข้อมูลว่าเป็นยา antibiotic ตามรูปเลยครับ ไม่ต้องอาศัย icode
ตามรูป อ.โก้ กล่าวเลยครับ รายงานจะเช็คว่าอย่างตัวไหนเป็น antibiotic บ้างจากวิธีการที่ อ.โก็แสดงครับ แล้วจะดึงออกมาตาราง opitemrece ตามคำสั่ง
select d.name,sum(o.qty) as qty,sum(o.qty)*d.unitcost as unitprice,sum(sum_price)as price from opitemrece o
inner join drugitems d on d.icode=o.icode
where o.vstdate between "2009-10-01" and "2009-10-31" and d.antibiotic="Y"
group by o.icode
order by qty desc