Saturday 7 October 2017

Date Functions

Oracle stores date in an internal numeric number
The default date and input format for any date is DD-MON-YY.
If you want to change the default date time then ,Set default datetime format in string literals by running below quer.

ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MM-YYYY';

SQL date functions are:


Oracle
1ADD_MONTHSAdd specified number of months
2EXTRACT for DatetimeExtract day, month, year etc from datetime
3LAST_DAYGet last date of month
4MONTHS_BETWEENGet number of months between two dates
5TO_CHAR for DatetimeConvert datetime to string
6TO_DATEConvert string to datetime
7TRUNC for DatetimeTruncate datetime

No comments:

Post a Comment