title: Using a SELECT statement within a WHERE clause
body: <pre><code>SELECT * FROM ScoresTable WHERE Score = 
    (SELECT MAX(Score) FROM ScoresTable AS st WHERE st.Date = ScoresTable.Date)
  </code></pre>
  
  <p>Is there a name to describe using a SELECT statement within a WHERE clause? Is this good/bad practice?</p>
  
  <p>Would this be a better alternative?</p>
  
  <pre><code>SELECT ScoresTable.* 
  FROM ScoresTable INNER JOIN 
    (SELECT Date, MAX(Score) AS MaxScore 
    FROM ScoresTable GROUP BY Date) SubQuery 
    ON ScoresTable.Date = SubQuery.Date 
    AND ScoresTable.Score = SubQuery.MaxScore
  </code></pre>
  
  <p>It is far less elegant, but appears to run more quickly than my previous version. I dislike it because it is not displayed very clearly in the GUI (and it needs to be understood by SQL beginners). I could split it into two separate queries, but then things begin to get cluttered...</p>
  
  <p>N.B. I need more than just Date and Score (e.g. name)</p>