Right now I have a table that looks like this but with around 1 million rows and over 100 company names.
Date | Company | Price 10/08/16 Exxon 2.00 10/08/16 Shell 1.95 11/08/16 Exxon 2.01 11/08/16 Shell 1.97
What is the best way to go about calculating the percent difference per day per company so that I end up with a table or view that looks like this.
Date | Company | % difference 10/08/16 Exxon .56 10/08/16 Shell .24 11/08/16 Exxon 1.005 11/08/16 Shell 1.01
would it be better to store each company as a column or keep it in row format, also how would I write the function so its not recalculating all million rows every day when I import new information.