title: show the customer who had the highest order amount in Northwind database
body: <p>I'm using the Northwind database, and for every region I need to show the customer who had the highest amount of order</p>
  
  <p>My tables are :</p>
  
  <pre><code>-- Customers --   
  [CustomerID] [nchar](5) NOT NULL,    
  [CompanyName] [nvarchar](40) NOT NULL,   
  [ContactName] [nvarchar](30) NULL,    
  [ContactTitle] [nvarchar](30) NULL,    
  [Address] [nvarchar](60) NULL,  
  [City] [nvarchar](15) NULL,    
  [Region] [nvarchar](15) NULL,    
  [PostalCode] [nvarchar](10) NULL,   
  [Country] [nvarchar](15) NULL,   
  [Phone] [nvarchar](24) NULL,    
  [Fax] [nvarchar](24) NULL,
  
  --OrderDetails
  [OrderID] [int] NOT NULL,
  [ProductID] [int] NOT NULL,
  [UnitPrice] [money] NOT NULL,
  [Quantity] [smallint] NOT NULL,
  [Discount] [real] NOT NULL,
  CONSTRAINT [PK_Order_Details] PRIMARY KEY CLUSTERED
  
  -- Orders
  [OrderID] [int] IDENTITY(1,1) NOT NULL,
  [CustomerID] [nchar](5) NOT NULL,
  [EmployeeID] [int] NULL,
  [OrderDate] [datetime] NULL,
  [RequiredDate] [datetime] NULL,
  [ShippedDate] [datetime] NULL,
  [ShipVia] [int] NULL,
  [Freight] [money] NULL,
  [ShipName] [nvarchar](40) NULL,
  [ShipAddress] [nvarchar](60) NULL,
  [ShipCity] [nvarchar](15) NULL,
  [ShipRegion] [nvarchar](15) NULL,  
  [ShipPostalCode] [nvarchar](10) NULL,
  [ShipCountry] [nvarchar](15) NULL,
  CONSTRAINT [PK_Orders] PRIMARY KEY CLUSTERED   
  </code></pre>
  
  <p>I start by trying to calculate for each customer his total amount </p>
  
  <pre><code>select 
      sum(unitprice * quantity * 1+Discount) as ValueOfOrders
  from 
      OrderDetails od 
  join 
      orders o on od.OrderID = o.OrderID 
  group by 
      CustomerID
  </code></pre>
  
  <p>But I don't know how to use <code>max</code> function to link it to region.</p>