SELECT .......
---a long calculation-- AS MARGIN,
---calculation--- AS SALES
FROM .....
where .....
GROUP BY .....
order by REV desc;
Now i want to add another column which is "Margin percent" which is MARGIN/SALES. How can i do it without calculating MARGIN and SALES again ? so the output table will be:
| Margin | SALES | Margin percent