ใน Sql query report
ChangeDBPipeLineLink6SQL('select p1.vn as vn,p1.physic_items_id as item_list,p1.doctor as doctor_code, '+
'p2.name as item_name,d.name as doctor_name, '+
'concat("[¡ÒÂÀÒ¾] ",if(p2.name is null," - ",p2.name)," # ",if(d.name is null," - ",d.name)) as PH_name '+
'from physic_list p1,physic_items p2,doctor d '+
'where p2.physic_items_id = p1.physic_items_id and d.code = p1.doctor and p1.vn = "'+DBPipeline['vn']+'" '+
'union '+
'select h1.vn as vn,h1.item_id as item_list,h1.doctor as doctor_code, '+
'h2.name as item_name,d.name as doctor_name, '+
'concat("[á¼¹ä·Â] ",if(h2.name is null," - ",h2.name)," # ",if(d.name is null," - ",d.name)) as PH_name '+
'from health_med_list h1,health_med_items h2,doctor d '+
'where h2.item_id = h1.item_id and d.code = h1.doctor and vn = "'+DBPipeline['vn']+'" ' +
'union '+
'select op.vn as vn,hm.item_id as item_list,op.doctor as doctor_code,hm.name as item_name,d.name as doctor_name, '+
'concat("[á¼¹ä·Â] ",if(hm.name is null," - ",hm.name)," # ",if(d.name is null," - ",d.name)) as PH_name '+
'from opitemrece op,health_med_items hm,doctor d '+
'where hm.icode=op.icode and op.doctor=d.code and op.vn = "'+DBPipeline['vn']+'" ');