BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: E-Hos ที่ พฤษภาคม 10, 2010, 10:22:23 AM
-
รบกวน ช่วยตรวจสอบโค๊ดให้หน่อยครับ เพราะว่า ลบหรือเพิ่มโรค ตรง and v.pdx!="Z4" and v.pdx!="Z348" ข้อมูลทีได้ไม่ตรงกันครับ นี่โค๊ดครับ... แนบรูปมาด้วยครับ :D :D :D :D :D
ขอรบกวนถามอีกอย่างครับ อยากรู้ว่าจะใช้คำสั่งยังไงครับ ว่าจะไม่เอาโรคที่ขึ้นต้นด้วย"Z..." ประมาณนี้ครับ คือไม่เอาโรคที่ขึ้นต้นด้วย Zครับผม ต้องเขียนโค๊ดยังไงครับ
เคยลองใช้ v.pdx != "Z%%" ก็ไม่ได้หรือว่าเขียนไม่ถูก :D :D :D :D ;D ;D ;D ;D
select v.pdx,b.name,count(distinct v.vn) as visit,count(distinct v.hn) as count_hn ,t.name
from vn_stat v
left outer join thaiaddress t on v.aid = t.addressid
left outer join icd101 b on v.pdx=b.code
where v.vstdate between "2008-10-01" and "2009-09-30" and t.addressid="421302"
and moopart= "9" and v.pdx !="" and v.pdx!="Z4" and v.pdx!="Z348"group by b.tname
order by visit desc
-
v.pdx like "Z%" (เอาที่ขึ้นต้นด้วย Z เท่านั้น)
v.pdx not like "Z%" (ไม่เอา Z)
-
select v.pdx,b.name,count(distinct v.hn) as 'case',count(v.vn) as 'total'
,t.name as tambon
from vn_stat v
left outer join thaiaddress t on v.aid = t.addressid
left outer join icd101 b on v.pdx=b.code
where v.vstdate between "2008-10-01" and "2009-09-30"
and t.addressid="621003" and moopart in (9,09) \\ใส่กันไว้
and v.pdx not like 'Z4%' \\ไม่เอาที่ pdx ขึ้นต้นด้วย Z4
and v.pdx not like 'Z348%' \\ไม่เอาที่ pdx ขึ้นต้นด้วย Z348
group by v.pdx
order by total desc
ลองประยุกต์ดู ผมใส่ addressid เป้นจังหวัดผม
-
v.pdx like "Z%" (เอาที่ขึ้นต้นด้วย Z เท่านั้น)
v.pdx not like "Z%" (ไม่เอา Z)
ขอบคุณครับ... ;D ;D ;D
select v.pdx,b.name,count(distinct v.hn) as 'case',count(v.vn) as 'total'
,t.name as tambon
from vn_stat v
left outer join thaiaddress t on v.aid = t.addressid
left outer join icd101 b on v.pdx=b.code
where v.vstdate between "2008-10-01" and "2009-09-30"
and t.addressid="621003" and moopart in (9,09) \\ใส่กันไว้
and v.pdx not like 'Z4%' \\ไม่เอาที่ pdx ขึ้นต้นด้วย Z4
and v.pdx not like 'Z348%' \\ไม่เอาที่ pdx ขึ้นต้นด้วย Z348
group by v.pdx
order by total desc
ลองประยุกต์ดู ผมใส่ addressid เป้นจังหวัดผม
;D ;D ;D ;D
ขอบคุณครับเดี๋ยวจะลองดูครับ.. ;D ;D ;D ;D ลืม not like ;D ;D