title: Count of result in group by query based on string length comparison of a column
body: <p>I have a table that looks like this:</p>
  
  <pre><code>| id | message                                                    | status |
  |----|------------------------------------------------------------|--------|
  | 1  | Lorem ipsum dolor sit amet                                 | pass   |
  | 2  | Lorem ipsum dolor sit amet, consectetur                    | fail   |
  | 3  | Lorem ipsum dolor sit amet, consectetur adipisicing elit   | fail   |
  |    | Lorem ipsum dolor sit amet, consectetur adipisicing elit   |
  </code></pre>
  
  <p>I want to be able to select the count of records with group by status. When a message string length is more than a certain number, I would like it's contribution towards the count to be <code>ceil(message_length/certain_number)</code>. For example, the 3rd message length is more than 70 characters. So, it should be counted as 2 instead of just 1. </p>
  
  <p>How should I go about it?</p>
  
  <p>I've tried the below query where I use <code>group_concat</code> on the message string but I know it's a wrong solution.</p>
  
  <pre><code>select ceil((char_length(group_concat(`message`)) - (count(`message`) - 1))/70) as count, `status` from `table` group by `status` 
  </code></pre>
  
  <p>The <code>- (count(message) - 1)</code> part was used to consider the commas introduced by <code>group_concat</code> function.</p>
  
  <p>The expected results for the query are:</p>
  
  <pre><code>| count | status |
  |-------|--------|
  |   1   |  pass  |
  |   3   |  fail  |
  </code></pre>