history order id是订单编号,怎么输出同一个订单内的菜名 数量 各自的价格,同一种菜要合并到一块,求求大佬们了
select food_name,nums,price from history where history_order_id = id参数
select food_name, sum(nums) nums, sum(price) price from food group by history_order_id, food_name
我是用的c语言调用MySQL