title: How to Calculate Top Customer in each City With Maximum order
body: <p>I had create table name <code>customers</code> <code>orders</code> and <code>orderdetails</code> as follow</p>
  
  <pre><code>CREATE TABLE `customers` (
    `customerNumber` int(11) NOT NULL,
    `customerName` varchar(50) NOT NULL,
    `contactLastName` varchar(50) NOT NULL,
    `contactFirstName` varchar(50) NOT NULL,
    `phone` varchar(50) NOT NULL,
    `addressLine1` varchar(50) NOT NULL,
    `addressLine2` varchar(50) default NULL,
    `city` varchar(50) NOT NULL,
    `state` varchar(50) default NULL,
    `postalCode` varchar(15) default NULL,
    `country` varchar(50) NOT NULL,
    `salesRepEmployeeNumber` int(11) default NULL,
    `creditLimit` double default NULL,
    PRIMARY KEY  (`customerNumber`)
  )
  
  CREATE TABLE `orders` (
    `orderNumber` int(11) NOT NULL,
    `orderDate` datetime NOT NULL,
    `requiredDate` datetime NOT NULL,
    `shippedDate` datetime default NULL,
    `status` varchar(15) NOT NULL,
    `comments` text,
    `customerNumber` int(11) NOT NULL,
    PRIMARY KEY  (`orderNumber`)
  ) 
  
  CREATE TABLE `orderdetails` (
    `orderNumber` int(11) NOT NULL,
    `productCode` varchar(15) NOT NULL,
    `quantityOrdered` int(11) NOT NULL,
    `priceEach` double NOT NULL,
    `orderLineNumber` smallint(6) NOT NULL,
    PRIMARY KEY  (`orderNumber`,`productCode`)
  )
  </code></pre>
  
  <p>After that I have to find out top ordered customer from each city.I had calculated total order by each customer as given below but I don't know how to select top one customer from each city with maximum order.
  So Question is how could I achive that.</p>
  
  <pre><code>SELECT o.customerNumber, ROUND( SUM( od.priceEach * od.quantityOrdered ) , 2 ) AS totalOrder
  FROM orders AS o
  INNER JOIN orderDetails AS od ON o.orderNumber = od.orderNumber
  GROUP BY o.customerNumber
  ORDER BY totalOrder DESC 
  </code></pre>
  
  <p>I'm using mysql.</p>