Mysql – How to select last 6 months from news table using MySQL

MySQLsql

I am trying to select the last 6 months of entries in a table, I have a column called datetime and this is in a datetime mysql format.

I have seen many ways using interval and other methods – which method should I use? Thanks

Best Answer

Use DATE_SUB

 .... where yourdate_column > DATE_SUB(now(), INTERVAL 6 MONTH)