FRESHERSHOME![]() |
This is a discussion on MySQL : need to sort results? within the MySQL forums, part of the Data Base Related category; Hi, I have 3 tables that I'm joining. -1st table has product id, product name -2nd has the margin rate ...
| |||||||
| Notices |
| MySQL MySQL Related discussion, MySQL configuration help, and everything related to MySQL |
![]() |
| | Thread Tools | Display Modes |
|
#1
| |||
| |||
| 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,
__________________ Powered by Yahoo! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Sitemap
Jobs by Location: Advertising and Marketing Jobs - IT Software Jobs - Walk-in Jobs - BPO Jobs - Government Jobs - Sales / BD Jobs - Tele Communication Jobs App Programming - Network Admin
Jobs By Location: Jobs in Bangalore - Jobs In India - Jobs in Delhi - Jobs in Hyderabad - Jobs in Kochi - Jobs in Mumbai - Jobs in Trivandrum - Jobs in pune - Jobs in Jonida - Jobs in Chennai - Jobs in Coimbator
Jobs Type: Full Time Jobs - Part Time Jobs
Latest Jobs - Accounting Jobs - Engineering Jobs - IT Jobs - Walkins - How to Face Interview - HR Round Tips - Career Info - Guide For Freshers - Apply for Jobs - Future Studies - Jobs Forums - Freshers IT Software Salary Details