How do I reduce the length of nested formulas by using references for previous formulas?
For example I would like to do the following but get an error:
(orders.size_0 + orders.size_1 + orders.size_2 + orders.size_3 + orders.size_4 + orders.size_5 + orders.size_6) AS tot_qty,
ROUND(tot_qty*orders.order_price,0) AS tot_price,
ROUND(tot_price/f.rate,0) AS price_gbp
Thanks,
Derek.
You may use a subqueries, for example –