ผมใช้ mysql 5.0.37 Hosxp 3.50.7.15 ครับ
เจอปัญหา รง 501 ผู้ป่วยในครับ บ้านเลขที่มันเป็น
?? ครับ
ก่อนหน้านี้ใช้ mysql 4.1 ไม่มีปัญหา ครับ
ขอคำแนะนำหน่อยครับ ในการแก้ไข
ด้านล่างเป็นคำสั่งใน from รายงาน 501 นะครับ
ขอบคุณครับ
select
"Thai" as eclinic ,
"Medicine" as admitdepart,
i.*,ip.regtime,ip.dchtime,ip.bw,
pcn.cardno as CID_CODE,
concat(pt.pname,pt.fname," ",pt.lname) as PT_NAME,
concat(pt.addrpart,"
? ",pt.moopart," ?.",t3.name," ?.",t2.name," ?.",t1.name) as ADDRESS,
sx.name as SEX_NAME,
mr.name as MARRYSTATUS,
oc.name as OCCUPATION,
pt.birthday as DOB,
pt.informname as INFORMNAME,
concat("<",pt.informrelation,">") as INFORMRELATION,
pt.informaddr as INFORMADDR,
pty.name as PTTYPENAME,
wd.name as WARD_NAME,
sp.name as SPCLTY_NAME,
ic.name as name,
ic1.name as name1,
ic2.name as name2,
ic3.name as name3,
ic4.name as name4
from an_stat i
left outer join ptcardno pcn on pcn.hn=i.hn and pcn.cardtype="01"
left outer join patient pt on pt.hn=i.hn
left outer join ipt ip on ip.an=i.an
left outer join sex sx on sx.code=pt.sex
left outer join marrystatus mr on mr.code=pt.marrystatus
left outer join occupation oc on oc.occupation=pt.occupation
left outer join pttype pty on pty.pttype=i.pttype
left outer join ward wd on wd.ward=i.ward
left outer join spclty sp on sp.spclty=i.spclty
left outer join icd101 ic on ic.code=i.pdx
left outer join icd101 ic1 on ic1.code = i.dx0
left outer join icd101 ic2 on ic2.code = i.dx1
left outer join icd101 ic3 on ic3.code = i.dx2
left outer join icd101 ic4 on ic4.code = i.dx3
left outer join thaiaddress t1 on t1.codetype="1" and t1.chwpart=pt.chwpart
left outer join thaiaddress t2 on t2.codetype="2" and t2.chwpart=pt.chwpart and t2.amppart=pt.amppart
left outer join thaiaddress t3 on t3.codetype="3" and t3.chwpart=pt.chwpart and t3.amppart=pt.amppart
and t3.tmbpart=pt.tmbpart
where i.an="500001474"
limit 1