title: MySQL nested select query performance
body: <p>Is there a difference between these two queries? Like performance issues, etc?</p>
  
  <p>Query 1:</p>
  
  <pre><code>select  i.invoice_id,
          i.total_price
    from ( select invoice_id, 
                  sum(price) as total_price 
             from orders
           group by 
                  invoice_id
          ) as i 
                 inner join invoice 
                     ON i.invoice_id = invoice.invoice_id
  </code></pre>
  
  <p>Query 2:</p>
  
  <pre><code>select invoice.invoice_id,
         orders.total_price 
    from invoice
         inner join ( select invoice_id, 
                             sum(price) as total_price 
                        from orders
                      group by 
                             invoice_id
                      ) orders 
             ON orders.invoice_id = invoice.invoice_id
  </code></pre>
  
  <p>Thanks!</p>