title: MySQL returns only first line when querying for MAX() and all names
body: <p>I have the following table:</p>
  
  <pre><code>students:
  name:     semester:
  AAAA      1
  BBBB      2
  CCCC      3
  DDDD      4
  </code></pre>
  
  <p>Where students is the name of the table and name &amp; semester are the colums.</p>
  
  <p>I want to select all the names and the max number of semesters.
  Therefore I use the following SQL-Statement:</p>
  
  <pre><code>SELECT MAX(semester), name FROM students;
  </code></pre>
  
  <p>As result I get the correct maximum number of semesters, but only the first name.</p>
  
  <p>Why does it only return one name and why the first of the table (and not the one with max semesters)?</p>
  
  <p>I'm not interested in how to fix this but in why it behaves like this.</p>
  
  <p>I'm using MariaDB 10.4.11.</p>