select SUM(case(a.st_code)when 'C' then (a.st_qty)when 'E' then (a.st_qty)when 'I' then (a.st_qty)when '7' then (a.st_qty)  else a.st_qty  end ) st_qty, 
SUM(isnull(a.lot_price,0)*(case a.st_code    when 'C'        then a.st_qty   when 'E' then a.st_qty   when 'I' then a.st_qty    when '7' then a.st_qty  else a.st_qty end )) st_acc 
from evst03d1 a   
left join evst03h b on a.st_list = b.st_list and a.st_code = b.st_code  
left join evsys14h c on c.sys_code=a.st_code  
left join mesel00h d on d.el_no = a.el_no  
left join mespb03h f on f.dp_no = b.dp_no  
left join evst02d1 g on g.dp_no = b.dp_no and g.el_no = a.el_no  
left join mespb04h h on h.sc_prno = b.sc_prno 
left join evst02d1 i on i.el_no = a.el_no and i.dp_no = b.dp_no   
LEFT JOIN evel10h j ON i.ma_no1 = j.ma_no1 AND i.dp_no = j.dp_no  where a.st_code in('9','R','8','1','N','C','E','I','7') and c.sys_id='ST' and a.rtd_cancel<>'Y' 
AND  b.st_date>='2010/09/01'   AND  b.st_date<='2010/09/07'   AND  b.dp_no='WS1' 
AND  j.ma_type='A'上面条SQL 查询语句,没加下面条件之前 查询时间为1秒,加了后面条件后就有2分多钟。实在郁闷,请各位大侠们帮小弟想想看是什么原因! 高分酬谢!