title: Inner join same table syntax error
body: <p>I'm trying to run an inner join between this same table. What is wrong with my syntax?</p>
  
  <pre><code>(SELECT user_key, bill_number, MAX(payment_date) AS payment_date 
   FROM billpayment) bpt 
   INNER JOIN (SELECT * FROM billpayment) bp
     ON bp.user_key=bpt.user_key 
     AND bp.bill_number=bpt.bill_number 
     AND bp.payment_date=bpt.payment_date 
   GROUP BY user_key, bill_number;
  </code></pre>
  
  <p>It says that the sql command is not properly ended at the parenthesis in 'billpayment)'</p>