Hello guys i am little bit confuse here with the code
can any one help me out ..
i want max customer paid in shopping and their name
i dont know that i am using right way or not but guide me here
Select sum(od.unitprice * od.quantity) as Amount,
(Select ContactName from Customers where customerId in (o.customerid)) as CustomerName from [Order Details] as od
inner join orders as o on o.orderid = od.orderid
inner join customers as c on o.customerid = c.customerid
group by o.customerid
here if i use
Max(sum(od.unitprice * od.quantity)) as Amount
i get error can you please correct the code... i want the customer name
who have paid amount very much.