I seem to be struggling with getting the average difference between the stock price of the last consecutive 2 days for each row and would appreciate any help towards this. I beleive there may be an easier way using Inner Joins but I have really struggled with it.
Here is my table
Symbol Date Price Date Price Date Price 1250 2015-01-14 47.51 2015-01-13 48.30 2015-01-12 48.80
I am trying to calculate average percentage difference between the last 2 days of Prices for all the rows. My table currently only has data for Symbol, Date and Price and what I would like to out put is
Symbol Date Price % Change Date Price % Change Date Price 1250 2015-01-14 47.51 -1.63 2015-01-13 48.30 2.02 2015-01-12 48.80
Thanks for any help or guidance I can get on this!