Find month to month percentage growth rate I have a table with following details 

year    month   entry
------------------------
2017    March   1
2017    April   1
2017    May     2
2017    June    9


Expected output

year |  month |entry |  growth rate
-----------------------------------
2017 |  March | 1    |    0 %
-----------------------------------
2017 |  April | 1    |    0 %
-------------------------------------
2017 |  May   | 2    |    50 %
-------------------------------------
2017 |  June  | 9    |    77 %
------------------------------------


Please post a MySQL query to view above.

My formula for growth rate is:

(current month entry - previous month entry) / (current month entry) * 100
You can use a variable to simulate a LAG() function, as far as I don't know how many records by month I've used a group by just to be sure.

select year, month, entry, 
       if(@last_entry = 0, 0, ((entry - @last_entry) / entry) * 100) "growth rate",
       @last_entry := entry                  
from
      (select @last_entry := 0) x,
      (select year, month, sum(entry) entry
       from   mytable
       group by year, month) y;


This is the result:

| year | month | entry | growth rate      |
|------|-------|-------|------------------|
| 2017 | 3     | 1     | 0                |
| 2017 | 4     | 1     | 0                |
| 2017 | 5     | 2     | 50               |
| 2017 | 6     | 9     | 77,7777777777778 |


rextester here