title: Issue Outputting Most Experienced Value
body: <p>Brand new to SQL.</p>
  
  <p>I am trying to output the most used application by user for 2018.  Version: MySQL v5.7</p>
  
  <p>Relations: </p>
  
  <ul>
  <li>user(UID: INT PRIMARY KEY, UNAME VARCHAR(100), LOCATION VARCHAR(100))</li>
  <li>application (AID: INT PRIMARY KEY, DID: INT NOT NULL, AppName VARCHAR(100), versionDate DATE)</li>
  <li>usageHistory(AID: INT NOT NULL, UID: INT NOT NULL, usageDate DATE NOT NULL)</li>
  </ul>
  
  <p>My current attempt is throwing an <code>Invalid Use of Group Function</code> exception</p>
  
  <pre><code>SELECT user.UID, application.AID
  FROM user
  INNER JOIN usageHistory ON usageHistory.UID = user.UID
  INNER JOIN application ON application.AID = usageHistory.AID
  WHERE YEAR(usageHistory.usageDate) = 2018
  GROUP BY user.UID
  HAVING MAX(COUNT(usageHistory.AID))
  </code></pre>
  
  <p>I want to display User's Name | Most used application for 2018.<br>
  Example: </p>
  
  <ul>
  <li>Steve Smith | Facebook</li>
  <li>Jane Smith  | Twitter</li>
  </ul>
  
  <p>(Pipes are purely for visualization)</p>