title: MAX() on COUNT() subquery that returns multiple rows
body: <p>I have a query that gets the number of rows returned within selecting records, my query looks like this:</p>
  
  <pre><code>SELECT rec.record_id,
         rec.record_title,
         usr.user_id,
         usr.username,
         (
             SELECT COUNT(DISTINCT rec.record_id)
             FROM records rec
             WHERE rec.record_title LIKE '%random%'
             GROUP BY rec.record_id
         ) AS total_records
  FROM 
  (
      records rec
  
      INNER JOIN members usr
  )
  WHERE rec.record_title LIKE '%random%'
  GROUP BY rec.record_id
  LIMIT 0, 25
  </code></pre>
  
  <p>I need to be able to return the number of records in the <code>total_records</code> subquery using the maximum number found when it includes <code>GROUP BY</code> and has multiple records returned which I only need one and that should be the number of records found within the subquery.</p>
  
  <p>How can you get the total records in the subquery by finding the maximum number found or <em>add</em> the multiple records together to make a number of records found.</p>