title: Join table on itself - performance
body: <p>I would like some help with the following join.
  I have one table (with about 20 million rows) that consists of:</p>
  
  <p><strong>MemberId (Primary Key) | Id (Primary Key) | TransactionDate | Balance</strong></p>
  
  <p>I would like to get the latest Balance for all the customers in one query.
  I know I could do something like this (I just wrote it from my memory). But this way is terribly slow.</p>
  
  <pre><code>SELECT * 
  FROM money 
  WHERE money.Id = (SELECT MAX(Id) 
                    FROM money AS m 
                    WHERE m.MemberId = money.MemberId)
  </code></pre>
  
  <p>Are there any other (faster/smarter) options?</p>