Vignesh Kumar

Vignesh Kumar

  • NA
  • 1k
  • 416.6k

Need QUERY HELP

Jun 13 2014 3:16 AM
Hi,

TABLE 1
TotalCost  MonthlyCost  SharedCost
$ 120            $10             $ 213
$ 240            $20            $ 256
I need to calculate these column like this
sum(TotalCost+1-SharedCost) as PreTotalCost
sum(MonthlyCost-SharedCost) as PostTotalCost

My expected output

TotalCost  MonthlyCost  SharedCost  PreTotalCost  PostTotalCost
$ 120             $10             $ 213           $ -92             $ -203
$ 240             $20             $ 256           $ -15            $ -236


Really appreciate any help on this.

Answers (5)