Hi,
Suppose, Database table has two column AMOUNT and DATE and also two rows. I want to get subtraction from first row to second row values of AMOUNT. What will be SQL Statement for this? Plz,help me.
Thanks.
How to get subtraction of two rows value
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 22, 2011, 2:48 AM EST
Hi Alok ,
if your table have auto increment column for that table then here is one way to do it.......
select acc2.Amount-acc1.Amount from account acc1 (nolock)
inner join Account acc2 (nolock)
on acc1.AccountID=acc2.AccountID-1
Note:- i have considered here AccountID is autoincrement column by 1
Thanks,
Pravin.