|
Hi all, I have a question and I'm not sure that I can explain my problem good enough. I need to select a record and to minus a value from previous record? I will send you data example what does the table contain: Previous records are as follow 18,0,31,275. Results should upear as below: If you have any suggestion or solution you are welcome Thanks in advanced
(comments are locked)
|
|
I hope this gives you the idea of what is needed Very close what I looked for... I will try it now.
Aug 10 '11 at 03:59 AM
Gogolo
Done..thanks a lot
Aug 10 '11 at 05:00 AM
Gogolo
(comments are locked)
|
|
A horrible RBAR cte solution........ +1 - for horrible!
Aug 10 '11 at 04:15 AM
Fatherjack ♦♦
Great solution too, thanks a lot for your effort.
Aug 10 '11 at 05:53 AM
Gogolo
(comments are locked)
|
|
This doesn't help you right now, but I just want to give you something to wait for. In the next version of SQL server (Denali) you would be able to calculate this with OVER clause like this, without any CTE, RBAR or cursor solutions: Clean and simple! :) If you like to try it, download CTP3 of Denali. Can you explain me more about "CTP3 of Denali" please
Aug 10 '11 at 05:54 AM
Gogolo
The next version of SQL server is called Denali and the community technology preview is availible for download from www.microsoft.com/sql
Aug 10 '11 at 06:09 AM
Håkan Winther
(comments are locked)
|


It might be better to give the 'raw' data, and the query you have used to get your results
Dear KEV, this is a content of table, I didn't use any query for it just a simple select *
I'm still not sure which value is being calculated from other values?
I will try to explain, value should minus with previous value for ex: Fread 27-25 29-27 etc..