select order_id, count(*) as totalItems, sum(order_qty*unit_price) as totalAmount from o_order_detail group by order_id select order_id, count(*) as totalItems, sum(order_qty*unit_price) as totalAmount from o_order_detail group by order_id