And as for the leap-year issue (yes, that could be an important issue which needs to be addressed) -- you would have to read the database's documentation for that function. It should explain what it does with Feb 28/29 and that may vary between databases.
posted 1 year ago
These examples are for Oracle SQL:
--Subtract one year from current date while taking a leap year into account.
SELECT ADD_MONTHS(SYSDATE,-12) FROM DUAL;
select add_months('28-FEB-2007', 1) from dual;
select add_months('28-FEB-2008', 1) from dual;
Let nothing stop you! Not even this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database