title: MySQL MAX function for categories without using GROUP BY clause
body: <p>I'm having a lot of trouble to figure out how to write the right code in MySQL. </p>
  
  <p>Here is what I have so far...</p>
  
  <pre><code>SELECT ProjectSteps.ProjectID, ProjectSteps.StepID, Step.StepName, Step.Definition 
  FROM ProjectSteps, Step 
  WHERE ProjectSteps.ProjectID = 
      (SELECT MAX(ProjectSteps.StepID) OVER ProjectSteps.ProjectID 
       FROM ProjectSteps 
       WHERE ProjectSteps.ProjectID IN (1, 2, 3) 
       )
  ORDER BY ProjectSteps.ProjectID;
  </code></pre>
  
  <p>For my query, I have 2 tables</p>
  
  <p><code>STEP (StepId, StepName, Definition)</code> </p>
  
  <p>and </p>
  
  <pre><code>ProjectSteps (StepID, ProjectId, StartingDate, EndingDate)
  </code></pre>
  
  <p>I have to get both the names of the step and of the step definition of the last step I have for every project.</p>
  
  <p>As:</p>
  
  <pre><code>Project ID  StepId   StepName  Definition
  </code></pre>
  
  <p><strong>I can't use a GROUP BY clause:(</strong></p>
  
  <p>Hopefully someone will get it right!</p>