0

How can i calculate Month on Month Growth Calculation in MySQL 5.7. There is no lag function in MySQL 5.7.

My DB contains is as follow

Date       State Value 
(dd/mm/yy) 
1/1/2017   01    25 
1/1/2017   02    35 
1/2/2017   01    45 
1/2/2017   02    58 
1/3/2017   01    68 
1/3/2017   02    78 

I need the output as below

Date     State Value MoM 
1/3/2017 01    68    XX% 
1/2/2017 01    45    XX% 
1/1/2017 01    25 
1/3/2017 02    78    XX% 
1/2/2017 02    58    XX% 
1/2/2017 02    35 

Thank you

N Rajkumar

Madhur Bhaiya
  • 28,155
  • 10
  • 49
  • 57
  • 2
    Possible duplicate of [Simulate lag function in MySQL](https://stackoverflow.com/questions/11303532/simulate-lag-function-in-mysql) – Raymond Nijland Sep 03 '18 at 15:59
  • Take a look at https://stackoverflow.com/questions/664700/calculate-a-running-total-in-mysql – Mr Ed Sep 04 '18 at 08:43
  • Take a look at https://stackoverflow.com/questions/664700/calculate-a-running-total-in-mysql – Mr Ed Sep 04 '18 at 08:45

0 Answers0