title: Postgresql how to calculate max of a count()
body: <p>I m trying to find out a way to calculate max of count(r.customer_id). When running the script there are 4 values with the same highest value, so what I need to produce is a table with these 4 values</p>
  
  <pre><code>SELECT     c1.customer_id, c1.first_name, c1.last_name, count(r.customer_id)
  FROM       customer c1 
  INNER JOIN rental r 
  ON         (c1.customer_id = r.customer_id)  
  WHERE      r.staff_id = 2 
  GROUP      BY c1.customer_id, c1.first_name, c1.last_name
  ORDER BY   4 desc
  </code></pre>