title: How to select a maximum value row in mysql table
body: <p>I have the following table</p>
  
  <p><strong>Table structure:</strong></p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `people` ( 
  `name` varchar(10) NOT NULL, 
  `age` smallint(5) unsigned NOT NULL, 
  PRIMARY KEY (`name`) 
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 
  </code></pre>
  
  <p><strong>Insert some values:</strong></p>
  
  <pre><code>INSERT INTO `people` (`name`, `age`) VALUES 
  ('bob', 13), 
  ('john', 25), 
  ('steve', 8), 
  ('sue', 13); 
  </code></pre>
  
  <p><strong>Executed Query:</strong></p>
  
  <pre><code>SELECT MAX(  `age` ) ,  `name` FROM  `people` WHERE 1
  </code></pre>
  
  <p><strong>Expected Result:</strong></p>
  
  <pre><code>25, John
  </code></pre>
  
  <p><strong>Generated Result</strong></p>
  
  <pre><code>25, bob
  </code></pre>
  
  <p>We can achieve this by using this query</p>
  
  <pre><code>SELECT `age`,  `name` FROM  `people` ORDER BY age DESC LIMIT 1
  </code></pre>
  
  <p><strong>Question 1 : What I made mistake here and why this MAX function is not return the relevant row information?</strong></p>
  
  <p><strong>Question 2: Which one is good to use, to increase performance MAX function or ORDER BY clause?</strong></p>