title: MySQL 5.7 - Error sql_mode=only_full_group_by
body: <p>After Updating to MySQL 5.7.11 we are getting a number of errors related to the sql_mode including only_full_group_by.</p>
  
  <p>Research shows we can turn this off but it would probably be better to know how to achieve the intended goal with properly structured SQL statements.</p>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>#1140 - In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'tblslideshow.slideImage'; this is incompatible with sql_mode=only_full_group_by</p>
  </blockquote>
  
  <p><strong>Query:</strong></p>
  
  <pre><code>SELECT
     tblslideshow.slideImage,
     COUNT(tblslideshow.slideID) AS countVal
  FROM
    tblslideshow
  WHERE
    tblslideshow.parentID = 3424
  </code></pre>
  
  <p>The goal is to return a list of values but also a Count for all returned records.
  What's the best way to achieve this goal without having to change the MySQL my.ini ? And why is it a Group By error is we're not even grouping? Or is Grouping part of the proper solution?</p>
  
  <p><strong>Expected Result should be:</strong></p>
  
  <pre><code>slideImage        |      countVal
  
  Image1.jpg        |      3
  
  Image2.jpg        |      3 
  
  Image3.jpg        |      3 
  </code></pre>
  
  <p>Edit: Since we are using PHP and MySQLi it may be wiser to exclude the Count() and just use "mysqli_num_rows"</p>