select DB_KC_XS.SP_Name,DB_KC_XS.SP_Price,sum(DB_KC_XS.SP_Num) as sp_num,DB_LB.LB_MC from DB_KC_XS,DB_LB where DB_KC_XS.LB_ID=DB_LB.LB_ID group by DB_KC_XS.SP_Name,DB_KC_XS.SP_Price,DB_LB.LB_MC order by SP_Num desc
而且,老兄, 铅笔 应该是
铅笔 2 3 办公用品
select DB_KC_XS.SP_Name,avg(DB_KC_XS.SP_Price) as SP_Price,sum(DB_KC_XS.SP_Num) as SP_Num,DB_LB.LB_MC from DB_KC_XS,DB_LB where DB_KC_XS.LB_ID=DB_LB.LB_ID group by DB_KC_XS.SP_Name,DB_LB.LB_MC order by SP_Num desc