title: MySQL interpreter calls query without an aggregate function an aggregate query
body: <p>I am trying to solve <a href="https://www.hackerrank.com/challenges/15-days-of-learning-sql/problem" rel="nofollow noreferrer">this HackerRank SQL coding challenge</a>. We have two tables, one called <code>Hackers</code> with columns <code>hacker_id</code> and <code>name</code> and another called <code>Submissions</code> with columns <code>submission_date</code>, <code>submission_id</code>, <code>hacker_id</code>, and <code>score</code>.</p>
  
  <p>One query I submitted to solve the challenge was: </p>
  
  <pre><code>SELECT  es.date, es.count, m.hacker_id, m.name, m.score
  FROM 
  (
      SELECT submission_date as date, COUNT(hacker_id) as count
      FROM (
          SELECT submission_date, COUNT(submission_id) as count, hacker_id
          FROM Submissions 
          GROUP BY submission_date, hacker_id
      ) f 
      HAVING count &gt;=1
  ) es
  JOIN (
      SELECT s.submission_date as date, s.hacker_id, h.name, s.score
      FROM Submissions s 
      JOIN Hackers h ON h.hacker_id = s.hacker_id 
      JOIN (SELECT submission_date, MAX(score) as score FROM Submissions GROUP BY submission_date) foo ON foo.submission_date = s.submission_date
      WHERE s.score = foo.score 
  ) m 
  ON es.date = m.date
  ORDER BY es.date
  </code></pre>
  
  <p>However, I got back the error: </p>
  
  <pre><code>ERROR 1140 (42000) at line 1: In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'f.submission_date'; this is incompatible with sql_mode=only_full_group_by
  </code></pre>
  
  <p>This really confused me since I didn't use an aggregate function in my query. Why did the interpreter give this error, and what should I think about to resolve it?</p>