Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)

  • RE: How to apply SUM function multiple times on a column?

    @Christopher

    Yes your solution works but as you said, @startposition is not going to play any role in it.

    And as long as different @startpositions are concerned, it is very tricky scenerio...

  • RE: How to apply SUM function multiple times on a column?

    @Christopher

    Yes your solution works but as you said, @startposition is not going to play any role in it.

    And as long as different @startpositions are concerned, it is very tricky scenerio...

  • RE: How to apply SUM function multiple times on a column?

    If @startposition = 1 and @endposition = 3 then Output column would be something like following

    DID-------ID--------Value---------Output

    1---------1-----------2------------2+12+45 = 59

    1---------2-----------12-----------12+45+8 = 65

    1---------3-----------45-----------45+8+63

    1---------4-----------8------------8+63+24

    1---------5-----------63-----------63+24

    1---------6-----------24-----------24

    2---------1-----------89-----------89+20+46

    2---------2-----------20-----------20+46+96

    2---------3-----------46-----------46+96

    2---------4-----------96-----------96

    I have to do it in one query without using loop....

  • RE: How to apply SUM function multiple times on a column?

    yes you got it right.

Viewing 4 posts - 1 through 4 (of 4 total)