row operation in same table and same coloumns
- by Raj
Hi!
i have a little problem to discuss i hope it will easy for you.
suppose i have table A with 2 columns as
item price
milk 25
milk 50
milk 100
Butter 25
Butter 100
Butter 200
now i want to display a table B derived from table A as
item price growth rate
milk 0
milk 100
milk 100
Butter 100
Butter 200
Butter 100
formula for growth rate for row1 is
((row[1]-row[0])/row[0])*100
eg for 1st row ((50-25)/25)*100
can you suggest a SQl Query for it