Retrieving the Previous row value to update in the current row

  • From the result set i need to update column b, select the value from column A in the previous row in the same resultset depending on the no of row available in the result set..

  • You might want to have a look at the following link:

    http://www.sqlservercentral.com/articles/T-SQL/68467/

    I think it has all the information to resolve the task you ask for.

    If you don't feel confident using the "quirky update" method you might want to take the time following the discussion related to that article. There is a (slightly slower) alternative "somewhere in between".

    If you need any further assitance please read the first link in my signature on how to post data.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

You must be logged in to reply to this topic. Login to reply