mysql get first day of the month

This will return the first day of the month '2009-08-01' in mysql

select SUBDATE('2009-08-31',DAYOFMONTH('2009-08-31')-1) from dual;

Comments

Popular posts from this blog

Vim vi how to reload a file your editing