How to calculate date from no. of months span in MySQL?

I have 1 date column date=2017-01-01 and I have no_of_months column having values like 20,30,50 etc.

Now, our date is 1 Jan 17, after adding 20 months I will have outputDate=1 Oct 2018

How to get outputDate as result?


Use function DATE_ADD

SELECT DATE_ADD(dateColumn, INTERVAL no_of_months MONTH) outputDate

in plain text as syntax

 SELECT DATE_ADD(DATE('2017-01-01'), INTERVAL 20 MONTH) outputDate