1, date comparison is accurate to day, you can use TRUNC (sysdate, ' dd ') function.
function support formats are: YYYY MM DD hh Mi
You can use Select TRUNC (sysdate, ' yyyy ') from the dual test to see
"Back": Date select Sysdate from dual--date
Select Trunc (sysdate) from dual
Select Trunc (sysdate, ' DD ') from dual--today's date
Select Trunc (sysdate, ' d ') +7 from dual--Sunday of the week
Select Trunc (sysdate, ' dy ') +7 from dual--Sunday of the week
Select Trunc (sysdate, ' Day ') +7 from dual--Sunday of the week
Select Trunc (sysdate, ' Q ') from dual--this season start date
Select Trunc (sysdate, ' month ') from dual--month start date
Select Trunc (sysdate, ' mm ') from dual--month start date
Select Trunc (Sysdate, ' year ') from dual--start date
Select Trunc (sysdate, ' yyyy ') from dual--year start date
Select Trunc (sysdate, ' HH24 ') from dual-This hour start time
Select Trunc (sysdate, ' MI ') from dual--this minute start time
Select Trunc (sysdate, ' CC ') from dual--time of the century
Select Trunc (Last_day (sysdate), ' DD ') from dual--last day of the month
2. Addition and subtraction of dates
Sysdate+1 Plus One day
SYSDATE+1/24 plus 1 hours
SYSDATE+1/(24*60) plus 1 minutes
SYSDATE+1/(24*60*60) plus 1 seconds
addition
Select Sysdate,add_months (sysdate,12) from dual; --plus 1 years
Select Sysdate,add_months (sysdate,1) from dual; --Add January
Select Sysdate,to_char (sysdate+7, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 weeks
Select Sysdate,to_char (sysdate+1, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 days
Select Sysdate,to_char (sysdate+1/24, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 hours
Select Sysdate,to_char (sysdate+1/24/60, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 minutes
Select Sysdate,to_char (sysdate+1/24/60/60, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 seconds
Subtraction
Select Sysdate,add_months (sysdate,-12) from dual; -Minus 1 years
Select Sysdate,add_months (sysdate,-1) from dual; --Minus January
Select Sysdate,to_char (sysdate-7, ' Yyyy-mm-dd HH24:MI:SS ') from dual; -Minus 1 weeks
select Sysdate,to_char (sysdate-1, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --minus 1 days
select Sysdate,to_char (sysdate-1/24 , ' Yyyy-mm-dd HH24:MI:SS ') from dual; -minus 1 hours
select Sysdate,to_char (sysdate-1/24 /60, ' Yyyy-mm-dd HH24:MI:SS ') from dual; -minus 1 minutes
select Sysdate,to_char (sysdate-1/24 /60/60, ' Yyyy-mm-dd HH24:MI:SS ') from dual; -minus 1 seconds
Oracle's date comparison and processing