select distinct df.hn,concat(p.pname,p.fname," ',p.lname)as fullname,n.name,df.fee_date,df.fee_amount,d.name,v.pttype,
v.pcode from doctor_fee_list df
left outer join doctor d on d.code = df.doctor
left outer join patient p on p.hn = df.hn
left outer join nondrugitems n on n.icode = df.icode
left outer join vn_stat v on v.hn = df.hn
where df.doctor = '006' and df.fee_date between '2010-04-01' and '2010-04-31'
and v.pcode in ("uc" ," AA" , "AB" , "AC" , "AE" ,"AG")
and (df.an is null or df.an=' ')
order by fee_date