Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle add months to sysdate

SELECT sysdate + 1 FROM dual; 				-- Tomorrow    12/01/2021 14:27:27
SELECT trunc(sysdate) + 1 FROM dual; 		-- Tomorrow    12/01/2021 00:00:00
SELECT sysdate + INTERVAL '20' DAY FROM DUAL;		-- 20 days ahead (other way)
SELECT sysdate + 1 / 24 FROM dual;					-- 1 hour ahead
SELECT sysdate + 1 / 24 / 60 FROM dual;				-- 1 minute ahead
SELECT add_months(trunc(sysdate), 1) FROM dual;   	-- 1 month ahead (no time)
SELECT trunc(sysdate) + 30 FROM dual;				-- 30 days ahead (no time)
SELECT add_months(trunc(sysdate), +12*2) FROM dual;	-- 2 years ahead (no time)
Comment

PREVIOUS NEXT
Code Example
Sql :: get all table names in sql 
Sql :: mysql change data type of column 
Sql :: mysql get age from date 
Sql :: oracle cannot access v$session 
Sql :: sort by last three charecter in sql 
Sql :: add postgresql to path 
Sql :: drop primary key 
Sql :: reset auto increment in mysql 
Sql :: column names in oracle sql 
Sql :: view linked servers sql 
Sql :: get first 3 letter of department name in sql 
Sql :: what is initial catalog in sql connection string 
Sql :: alter table sql 
Sql :: mysql sysdate - 1 day 
Sql :: Syntax of for-loop in SQL Server 
Sql :: how to delete git repo locally 
Sql :: sql asynchronous stored procedure call 
Sql :: find difference in dates sql 
Sql :: mysql tables max count 
Sql :: show size database mysql 
Sql :: MySQL insert into examble 
Sql :: how to alter length character varying postgres 
Sql :: delete role postgres 
Sql :: start postgres server 
Sql :: how to remove a column from a table in MySQL 
Sql :: drop foreign key mysql 
Sql :: ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails 
Sql :: postgresql change default value 
Sql :: how to get the number of columns in a table in sql 
Sql :: 2nd highest salary in mysql 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =