Hi i have sql that has 4 calculation as the one below with difference being in the interval.
I have cost1 cost2 cost3 cost4 for different interval, Im also having quatities that i multiple to the costs on my outer query. I realize my query takes like 28 sec to return 66 rows.
when i remove the cost subquery calculation it takes a 1 sec. I how can i optimize the ff subquery. Im using the subquery to get the latest cos.NewCostPric e...