你判断I_type 是否等于2,3,4里面
select min(a.cost) AS COST, b.materialid ,b.qty1  ,b.goodsid 
       from  goodsshop a ,recipe b where a.goodsid = b.materialid   and b.goodsid = i_goodsid
       group by  b.materialid ,b.qty ,b.goodsid  I_type =3和I_type =4里面类似错误