oracle sysdate

Solutions on MaxInterview for oracle sysdate by the best coders in the world

showing results for - "oracle sysdate"
Noah
02 Oct 2018
1SELECT sysdate - 1 FROM dual; 				-- Yesterday    12/01/2021 14:27:27
2SELECT trunc(sysdate) - 1 FROM dual; 		-- Yesterday    12/01/2021 00:00:00
3SELECT sysdate + INTERVAL '20' DAY FROM DUAL;		-- 20 days ahead (other way)
4SELECT sysdate - 1 / 24 FROM dual;					-- 1 hour ago
5SELECT sysdate - 1 / 24 / 60 FROM dual;				-- 1 minute ago
6SELECT add_months(trunc(sysdate), -1) FROM dual;   	-- 1 month ago (no time)
7SELECT trunc(sysdate) - 30 FROM dual;				-- 30 days ago (no time)
8SELECT add_months(trunc(sysdate), -12*2) FROM dual;	-- 2 years ago (no time)
9
10-- ⇓ Test it ⇓ (Fiddle source link)