Question

need your help. I tried myself but cant solve it.

I have a table with date column (ex. birth) So i need to select all rows where birth is in past more than one months.

I googled and found a SO question similar The difference in months between dates in MySQL

But there is no a condition by this new period. My wrong query is:

select id,period_diff(date_format(now(), "%Y%m"), date_format(birth, "%Y%m")) as months 
from t1
where months>0 
limit 10

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top