title: selecting max record in mysql
body: <p>I have a table of multiple transactions. I am trying to get the row of the last transaction.
  I am using the following:</p>
  
  <pre><code>select n.AccountNumber, max(PostDate), f.TransAmt 
  from mp_cycle n, fintrans f
  where n.AccountNumber = f.AccountNumber
  and TransCode &gt;= '50'
  and TransCode &lt;= '59'
  group by n.AccountNumber
  </code></pre>
  
  <p>This is returning the last date for a particular account, but the TransAmt is not for the same record.</p>
  
  <p>ie:</p>
  
  <pre><code>Acct #  Date   Amt
  1       1/1    10.00
  1       1/2    11.00
  1       1/3    12.00
  2       1/2    20.00
  2       1/3    21.00
  2       1/4    22.00
  </code></pre>
  
  <p>My select will return the last date for each account, so 1/3 for act # 1 and 1/4 for act # 2, but the Amt field is not the amt that goes with that record.</p>
  
  <p>Any assistance will be greatly appreciated.</p>