Tutorial by Examples

Oracle supports DATE (includes time to the nearest second) and TIMESTAMP (includes time to fractions of a second) datatypes, which allow arithmetic (addition and subtraction) natively. For example: To get the next day: select to_char(sysdate + 1, 'YYYY-MM-DD') as tomorrow from dual; To get the ...
Syntax: add_months(p_date, integer) return date; Add_months function adds amt months to p_date date. SELECT add_months(date'2015-01-12', 2) m FROM dual; M2015-03-12 You can also substract months using a negative amt SELECT add_months(date'2015-01-12', -2) m FROM dual; M2014-11-12 When the...

Page 1 of 1