title: Hive query to get max of count
body: <p>My input file is like this:</p>
  
  <pre><code>id,phnName,price,model
  1,iphone,2000,abc
  2,iphone,3000,abc1
  3,nokia,4000,abc2
  4,sony,5000,abc3
  5,nokia,6000,abc4
  6,iphone,7000,abc5
  7,nokia,8500,abc6
  </code></pre>
  
  <p>I want to write a hive query to get the max count of a particular phone.</p>
  
  <p>output:</p>
  
  <pre><code>iphone 3
  nokia 3
  </code></pre>
  
  <p>till now I've tried the following query:</p>
  
  <pre><code>select d.phnName,count(*) from phnDetails d group by d.phnName
  </code></pre>
  
  <p>and got output like this:</p>
  
  <pre><code>iphone 3
  nokia 3
  sony 1
  </code></pre>
  
  <p>Help me to retrieve only the max value.</p>