sql server - Can I retrieve a value from a previous line using CURSORs of SQL? -


I am developing a query where I need that the result of a certain area of ​​"current area" of my current line Ho. My current row "+" The same area of ​​the previous row "(SQL Server 2008)

How do I do this by using the cursor?

Assign the previous line value in one variable:

  declare @previosvalue varchar (100) = null; proclaim @ servbentvalue Announcement (100); Announce the crs cursor for the selected value from the table; Open CRS; Bring @ctitival ahead to CRC; While @@ fetch_status = 0 start - process here - In the first line, @previousvalue As it should be, since there is no 'back' of the first selection ... for some time where some sorting = @ currentvalueval and other conditions = @ previous price; set @previousvalue = @currentvalue; ahead of CRC @ CERTIFICATE CRAS; DLLL CRS;  

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -