SyntaxFix
Write A Post
Hire A Developer
Questions
select orderID, sum(subtotal) as order_total from ( select orderID, productID, price, qty, price * qty as subtotal from product p inner join orderitem o on p.id = o.productID where o.orderID = @orderID ) t group by orderID