優化一條SQL
select billno,itemno,matno,(select matnm from bmt_mat b where b.matno= a.matno),
unitnm,pqty+lqty as qty,plus from mit_bill_detail a
where a.matno = 'AA0019001010' and a.facno = 'WHT03111034' and facid = 'A'
union all
select c.billno,c.itemno,c.matno, (select matnm from bmt_mat d where d.matno= c.matno),
c.unitnm,(select qty from mit_bill_attach where billno = c.billno and seq = c.seq and facno ='WHT03111034' and facid = 'A' ),plus from mit_bill_detail c
where c.matno = 'AA0019001010'
and c.billno in (select billno from mit_bill_attach where
facno ='WHT03111034' and facid = 'A' )
誰能夠幫我優化一下上面的語句,感覺寫得好累贅啊