title: Select a record which has the highest value in a column in Rails
body: <p>I have a column called 'frequency' in my database. I want to select the records of a particular category in which frequency is more. Like there will be 5 records of same category but each may have different frequency. Out of all these 5 records, I want the record whose value in frequency is more.</p>
  
  <p>Say, </p>
  
  <p>record 1 frequency value = 10 <br>
  record 2 frequency value = 20 <br>
  record 3 frequency value = 30 <br>
  record 4 frequency value = 10 <br>
  record 5 frequency value = 50 <br>
  I want record 5 as my output. </p>
  
  <p>Thanks.</p>