select b.hn,concat(pname,fname,' ',lname) as ptname,b.vstdate,b.icode,concat(a.name,' ',strength) as drugname,b.qty,a.units
from opitemrece b
left outer join drugitems a on a.icode=b.icode
left outer join patient c on b.hn=c.hn
where vstdate between '2008-05-02'and'2008-05-06'
and b.icode in ('1000315','1000311','1000039','1500070','1000427','1000622','1000659','1000515'
,'1000516','1000529','1000312','1000744','1000745','1000746','1000182')
order by icode ,vstdate
ได้แล้วครับ