ลองพิมพ์
select o.vn,o.hn,o.paid_money,concat(p.pname,p.fname,' ',p.lname) as ptname from vn_stat o left outer join pq_doctor d on d.vn=o.vn left outer join rx_operator r on r.vn=o.vn left outer join rcpt_print i on i.vn=o.vn left outer join patient p on p.hn=o.hn left outer join ovst v on v.vn=o.vn where o.vstdate='2011-11-01' and o.vn in (select vn from rcpt_print where bill_date_time between '2011-11-01 00:00:00' and '2011-11-01 23:59:59' and bill_amount>0 ) and o.paid_money > 0 group by o.vn,o.hn,o.paid_money ,p.pname,p.fname,p.lname ,v.vsttime having (count(d.vn)>0 or count(r.vn)>0 ) order by o.vn ครับ..ว่าแสดงรายการหรือไม่