title: Do math in MySQL from SELECT
body: <p>I have MySQL query like this</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT `transaction`.id,
  CONCAT(contact.`name`, " ", contact.last_name) as fullName,
  (SELECT SUM(total) FROM transaction_product WHERE transaction_product.ref_transaction = `transaction`.id) as subtotal,
      (SELECT SUM(transaction_payment.idr_cash + transaction_payment.idr_bni + transaction_payment.idr_ame_exp + transaction_payment.idr_cc_niaga) FROM transaction_payment WHERE transaction_payment.`transaction` = `transaction`.id ) AS payment,
      (subtotal - payment) as balance
  FROM `transaction`
  LEFT JOIN contact
      ON contact.id = `transaction`.contact_id
  WHERE reservation_status = 3
      AND `transaction`.id = 6345
  </code></pre>
  
  <p>As you see, I want to get the balance which that math come in SELECT. <code>(subtotal - payment) as balance</code><br>
  how should I do that?</p>