title: Calculating total amount using two columns, with a percentage?
body: <p>I have built a table that includes various items, item id's and prices etc - I also have a list of stored customers on my database and the items that they bought.</p>
  
  <p>I would like to be able to calculate my total VAT (16%)  for these items, only the ones sold (not unsold items).</p>
  
  <p>I tried this code:</p>
  
  <pre><code>SELECT sum(items.price*sales.amount) as 'Total Sold', sum((items.price*sales.amount)*0.16) AS 'Estimated Total Vat Amount'
  FROM sales
  </code></pre>
  
  <p>But the result that followed was an 'unknown column' although it does exist. On looking online is encourages me to use an 'inner join' but if possible I would prefer to use something else..</p>
  
  <p>Is that possible? if so, what could I use to get my result?</p>
  
  <p>Thanks.</p>