title: How to correctly SELECT from subquery yielded table
body: <p>I'm trying to execute a <code>SELECT * FROM WHERE result.usd_equivalent &gt; 10</code> on a table that is yielded by my subquery. I'm new to this and unsure if I'm writing this correctly but below query gives an error saying <code>Error Code: 1060. Duplicate column name 'currency'</code>. I've also set the alias of the subquery as <code>result</code>:</p>
  <pre><code>SELECT * FROM
  (
  SELECT *, t.amount / POWER(10,  cd.exponent) * fx.rate AS &quot;usd_equivalent&quot; 
  FROM new_schema.transactions t
      JOIN new_schema.fx_rates fx
      ON t.currency = fx.ccy
      JOIN new_schema.currency_details cd
      ON t.currency = cd.currency
      WHERE fx.base_ccy = &quot;USD&quot;
  ) result
  WHERE result.usd_equivalent &gt; 10;`
  </code></pre>
  <p>I just want to fetch the rows as per my <code>WHERE</code> clause from the yielded table. How can I do this correctly?</p>