Forum Replies Created

Viewing 2 posts - 1 through 3 (of 3 total)

  • RE: Optimize update that uses subquerys with aggregates

    Well...

    after reading the article I'm doing this:

    update MyTable

    set MyTable.SumValue1=RTC.RunningTotal1

    ,MyTable.SumValue2=RTC.RunningTotal2

    from

    (select

    Date

    ,RunningTotal1

    ,RunningTotal2

    from MyTable T1

    CROSS APPLY

    (select

    RunningTotal1=sum(Value1)

    ,RunningTotal2=sum(Value2)

    from MyTable T2

    where T2.Date <= T1.Date

    ) as RT

    ) as RTC

    where MyTable.Date=RTC.Date

    I think that there...

  • RE: Optimize update that uses subquerys with aggregates

    Hi,

    I've tried to execute this query but it doesn't runs. It returns this error:

    Msg 4104, Level 16, State 1, Line 1

    The multi-part identifier "MyTable.Date" could not be bound.

    Any...

Viewing 2 posts - 1 through 3 (of 3 total)