Returns the system date
SELECT SYSDATE FROM dual
returns the date and time of the system date
SELECT SYSTIMESTAMP FROM dual
CURRENT DATE - our timezone date
SELECT CURRENT_DATE FROM dual
CURRENT TIME STAMP - our timezone time
SELECT CURRENT_TIMESTAMP FROM dual
DATABASE TIME ZONE - DB time
SELECT DBTIMEZONE FROM dual
EXTRACT - seperates individual part of date
SELECT EXTRACT(YEAR FROM SYSDATE) FROM dual
1
12
to_char
select to_char(hire_date,'Month') from [Link]
jan
ADD MONTHS - adding number of months to date
SELECT ADD_MONTHS( DATE '2016-02-29', 1 ) FROM dual
start date of every date
SELECT TRUNC(DATE '2017-07-16', 'MM') FROM dual
SELECT TRUNC(SYSDATE,'MM') FROM dual
return number of months between two months
SELECT MONTHS_BETWEEN( start_date,End_date ) FROM dual
character to date value
SELECT TO_DATE( '01 Jan 2017', 'DD MON YYYY' ) FROM dual
SELECT NEXT_DAY( DATE '2000-01-01', 'SUNDAY' ) FROM dual
LAST DAY - gets last day of month
SELECT LAST_DAY(SYSDATE) FROM dual
Ajith - substr('Ajith',1,1)
Using without rank top 2nd salary
select max(salary) from [Link]
where salary < (select max(salary) from [Link])