I have a query where I calculate ((sum(field a) / 1000) * field b) as total. I now need to calculate total of newly created total column. Is this possible?
I am a little new at this so I am posting the actual query as I am not sure how to incorporate the above into the query, although I am tyring currently. Anyhow here's the query;
select wip_fg.order_no, sum(wip_fg.trx_qty) as trx_qty, ((sum(wip_fg.trx_qty) / 1000) * orders.ord_price) as ord_$
from wip_fg inner join orders on wip_fg.order_no=orders.order_no inner join spec_file on wip_fg.item_no=spec_file.item_no
where wip_fg.trx_datetime>='2010-1-20 07:00' and wip_fg.trx_datetime<='2010-1-20 15:00'
and spec_file.prod_cd in ('chip', 'chip1', 'chip2') and orders.plt_no=1
group by wip_fg.order_no, orders.ord_price
I am not sure where to place the above. Your help is greatly appreciated!