select food_name,sum(nums),sum(price) from current_order where status=0 group by food_name;
这是sql,你可以查询试试。然后放进c调用数据库中就行。