title: How to find the maximum of a column in Hive?
body: <p>My code:</p>
  
  <pre><code>add jar /home/edureka/Downloads/csv-serde-1.1.2.jar;
  
  Create table loan(id int,loan_amt int,grade string)
  row format serde 'com.bizo.hive.serde.csv.CSVSerde'
  stored as textfile;
  
  load data local inpath 'Desktop/LMS/Hive_Project/Loan Data.csv' into table loan;
  
  select id,loan_amt,grade from loan
  where grade="A"
  sort by loan_amt desc
  limit 5;
  </code></pre>
  
  <p>But my results is wrong.
  I am getting some random valuw which is not the top 5</p>