Select MySQL 3 months values -
i need select 3 month's values database except first day values of third month.
for example:
i want select values 3 months since now: may, april, march without values 1 march
every day of month has 24 hour values temperature , want exclude first day of third month said before.
thank you!!
get first day of month(in 3 months) - how first day of every corresponding month in mysql?
cast(date_format(date_add(now(),interval 2 month) ,'%y-%m-01') date)
get query between dates:
date between now() , date_add(now(), interval 3 month)
and query should like:
where date between now() , date_add(now(), interval 3 month) , date != cast(date_format(date_add(now(),interval 2 month) ,'%y-%m-01') date)
Comments
Post a Comment