I am trying to achieve the following layout. If I select curdate() which is june i should get previous 6 months.6 months should include June also .i.e. if curdate = june 25-2018 my out out should be months from June-2018 until Jan-2018. Can anyone please help me out with syntax. All I have now is individual queries which will give me previous 6 months in MYSQL.
Month Previous Months june may apr mar feb jan may apr mar feb jan DEc
Use the Date_Add function. See examples below:
Code I used to setup test: