• Now I have to get the row sum of each column from D1 to D4.

    Example: the desired result set would be like the below

    Cid TagId Name D1 D2 D3 D4 D5 tot(D1andD2) tot(D3andD4)

    1 47 American 1000 500 300 0 0 1500 300

    1 47 American 1000 0 300 0 500 1000 800

    Any idea?