แบบ SQL
select d1.*,v1.*,o1.*,s.*,rx.* , rx.print_count as pc
from doctor_order_print d1
left outer join vn_stat v1 on v1.vn=d1.vn
left outer join ovst o1 on o1.vn=d1.vn
left outer join s_drugitems s on s.icode=d1.icode
left outer join rx_operator rx on rx.vn=d1.vn
where d1.vn="470531084436" and d1.print_server="MANOI-NOTEBOOK"
and d1.print_mode=1 and s.income in("03","05")
order by d1.item_no