ลองไปใช้กันนะครับB4 : การให้รหัส ผู้ป่วยนอก ที่มารับวัคซีนป้องกันโรค ไม่ต้องใส่รหัสการตรวจร่างกาย การตรวจสุขภาพ
เดี๋ยวมีมาเพิ่ม...ถ้าว่าง
select t1.* from (select odx.vn, odx.hn, concat(pt.pname,pt.fname,' ',pt.lname) as pt_name, odx.vstdate from ovstdiag odx join patient pt on pt.hn=odx.hn where vstdate between '2014-10-01' and '2015-09-30' and icd10 between 'Z230' and 'Z279') as t1 join (select vn from ovstdiag where vstdate between '2014-10-01' and '2015-09-30' and (icd10 between 'Z000' and 'Z029')) as t2 on t2.vn=t1.vn |
ลองไปใช้กันนะครับB4 : การให้รหัส ผู้ป่วยนอก ที่มารับวัคซีนป้องกันโรค ไม่ต้องใส่รหัสการตรวจร่างกาย การตรวจสุขภาพ
เดี๋ยวมีมาเพิ่ม...ถ้าว่างลองแล้วใช้ได้ทุกอันยกเว้นข้อ B4
select t1.* from
(select odx.vn, odx.hn, concat(pt.pname,pt.fname,' ',pt.lname) as pt_name, odx.vstdate
from ovstdiag odx
join patient pt on pt.hn=odx.hn
where vstdate between '2014-10-01' and '2015-09-30'
and icd10 between 'Z230' and 'Z279') as t1
join
(select vn from ovstdiag
where vstdate between '2014-10-01' and '2015-09-30'
and (icd10 between 'Z000' and 'Z029')) as t2 on t2.vn=t1.vn
สงสัยอ.ลืมปิด ) สีแดงครับอ.โก็ มันเลยไม่รันครับ
ทำเป็นตัวอย่างใน App Store ให้แล้วครับ รอผู้มีวิทยายุทธ เอามาแก้ให้สมบูรณ์ครับLike รัว ๆ เลยครับ ;D ;D ;D