ashishkukreja
08-17-2007, 10:16 PM
How can we calculate a difference of column
Example
when I have a table containing a single row i.e.
Numbers
66
45
23
52
523
563
452
133
Now I required a query that must show a difference like this
Numbers ------------------ Difference
66 ------------------------ 0
45 ------------------------ -21----------- (45-66)
23 ------------------------ -22 ------------(23-45)
52 ------------------------ +29 ------------ (52-23)
523 ------------------------ +471----------- (523-52)
563 ------------------------ +40 ------------ (563-523)
452 ------------------------ -111 ----------- (452-563)
133 ------------------------ -319 ------------(133-452)
So it is possible or not
Please tell me
Waiting for reply
Thanks
Ashish
Example
when I have a table containing a single row i.e.
Numbers
66
45
23
52
523
563
452
133
Now I required a query that must show a difference like this
Numbers ------------------ Difference
66 ------------------------ 0
45 ------------------------ -21----------- (45-66)
23 ------------------------ -22 ------------(23-45)
52 ------------------------ +29 ------------ (52-23)
523 ------------------------ +471----------- (523-52)
563 ------------------------ +40 ------------ (563-523)
452 ------------------------ -111 ----------- (452-563)
133 ------------------------ -319 ------------(133-452)
So it is possible or not
Please tell me
Waiting for reply
Thanks
Ashish