日期:2014-05-16  浏览次数:20973 次

如何优化下面的sql语句
select t_commoditytype.commo_name ,t_commodity.ac_code,t_commodity.commo_id,t_factory.fac_name,
t_commoditytype.commo_chandi,t_commoditytype.alcohol,t_commoditytype.net_content,
t_commoditytype.flavor,t_commoditytype.materials,t_commoditytype.com_class,
t_commoditytype.commo_standard,t_commoditytype.commo_xukenum,t_commodity.retail_price,"
t_commoditytype.license,t_commodity.produce_date,t_vendors.ven_address,
t_vendors.ven_name,t_commodity.dist_date,t_salebus.sale_name,t_salebus.sale_address,t_salebus.sale_tel" 
from t_commodity,t_commoditytype,t_factory,t_salebus,t_vendors where t_commodity.ac_code in ("
+ link
+ ")"
+ "and LEFT (t_commodity.ac_code,13)=t_commoditytype.commo_code group by t_commodity.ac_code;

------解决方案--------------------
t_commodity.ac_code、t_commodity.ac_code是否有索引。