I have this SQL that Groups orders by EAN. But is it possible in the output file to show the total price for each EAN? So I would like num,ber of orders for each EAN and the total sum of Price?
SELECT top 100000
o.Identifier as 'Order Identifier',
p.Identifier as 'ITEM',
p.Family as 'ITEM_PARENT',
m.Name as 'BRAND',
p.VoVgr as 'SubClass',
FROM StarOrder o
INNER JOIN StarOrderItem oi on oi.OrderID = o.ID
INNER JOIN StarCustomer c on c.ID = o.CustomerID
INNER JOIN StarProduct p on p.ID = oi.ItemID
INNER JOIN StarManufacturer m on m.ID = p.ManufacturerID
where m.Name='Bobbi Brown'
and o.CreatedAt between '2015/11/27' and '2015/11/29'
ORDER BY P.EAN;