title: MySQL how to reuse Alias to create Alias
body: <p>I am facing problem of Alias in MySQL,I have a database call 'Table_Profit' and this is my query and it works fine:</p>
  <pre><code>$sql=&quot;SELECT *,
  Profit*24 AS 'Daily_Profit',
  Profit*30*24 AS 'Monthly_Profit',
  from Table_Profit;
  </code></pre>
  <p>But now I want to add another Alias(Total_Profit)by using other Alias and it doesn't work, how can I solve this problem?:</p>
  <pre><code>$sql=&quot;SELECT *,
  Profit*24 AS Daily_Profit,
  Profit*30*24 AS Monthly_Profit,
  Daily_Profit*Monthly_Profit AS Total_Profit
  from Table_Profit;
  </code></pre>
  <p>I have try to use Derived table but it doesn't work.</p>
  <pre><code>$sql=&quot;SELECT *,
  Profit*24 AS Daily_Profit,
  Profit*30*24 AS Monthly_Profit,
  from (
  select 
    Daily_Profit*Monthly_Profit AS Total_Profit
  from Table_Profit
  )AS P;
  </code></pre>