Hi,
I have 3 tables that I'm joining.
-1st table has product id, product name
-2nd has the margin rate applied to each product
-3rd has the ecotax applied to each product
I'm writing a select request that displays the following results:
products_id | products_name | products_cost | products_price

My problem is that the products_price column is resulting from following calculation: ((products_cost * products_margin) + products_ecotax) and I can't get to sort the results on that column. MySQL won't accept the alias that I created.

Here's my full MySQL request:
"SELECT p.products_id AS 'Id', p.products_name AS 'Name', p.products_cost AS 'PC', ((p.products_cost/(1-(m.margin_rate_value/100)) )+e.ecotax) AS 'final price' FROM products p LEFT JOIN margins m ON p.products_id=m.products_id LEFT JOIN ecotax e ON p.products_id=e.products_id ORDER BY 'final price' ASC";

Is there any way to get the results sorted on the last column by MySQL?

Thanks in advance for your help,