คำสั่งแสดงข้อมูลที่อยู่ ในโปรแกรม HOSxP (บันทึก)


SELECT concat(pt.addrpart," หมู่ที่ ",pt.moopart," ต.",t3.name," อ.",t2.name," จ.",t1.name) as fulladdressname
FROM patient pt
LEFT JOIN  thaiaddress t1 on t1.chwpart=pt.chwpart and t1.amppart="00" and t1.tmbpart="00"
LEFT JOIN  thaiaddress t2 on t2.chwpart=pt.chwpart and t2.amppart=pt.amppart and t2.tmbpart="00"
LEFT JOIN   thaiaddress t3 on t3.chwpart=pt.chwpart and t3.amppart=pt.amppart and t3.tmbpart=pt.tmbpart 
WHERE pt.hn = "xxxxxxxxxx"
LIMIT 1 


Share on Google Plus

About Mamakio

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 ความคิดเห็น:

แสดงความคิดเห็น