Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle difference between two dates in seconds

SELECT (END_DT - START_DT) * 60 * 60 * 24 FROM MY_TABLE;   	-- Seconds
SELECT (END_DT - START_DT) * 60 * 24 FROM MY_TABLE;   		-- Minutes
SELECT (END_DT - START_DT) * 24 FROM MY_TABLE;   			-- Hours
Comment

oracle difference between two dates in years

select floor(months_between(date '2012-10-10', date '2011-10-10') /12) from dual;

select floor(months_between(date '2012-10-9' , date '2011-10-10') /12) from dual;
Comment

oracle all dates between two dates

-- All dates between 01/01/2021 and 15/01/2021
SELECT to_date('01/01/2021', 'DD/MM/YYYY') + ROWNUM - 1
FROM ALL_OBJECTS
WHERE ROWNUM <= to_date('15/01/2021', 'DD/MM/YYYY') 
	- to_date('01/01/2021', 'DD/MM/YYYY') + 1;
Comment

oracle difference between two dates in days

  v_numvar := dt1-dt2;
Comment

PREVIOUS NEXT
Code Example
Sql :: The local psql command could not be located 
Sql :: how to connect postgresql database with java 
Sql :: create function syntax sql server 
Sql :: rename table name 
Sql :: mysql check date range 
Sql :: change filed order in mysql 
Sql :: mysql delete duplicates 
Sql :: change mariadb to mysql xampp 
Sql :: SQL ORDER BY ASC (Ascending Order) 
Sql :: Parsing XML IN SQL Server 
Sql :: create delete procedure mysql 
Sql :: sqlite create tables 
Sql :: xampp mysql version 
Sql :: mysql server not starting in xampp in mac 
Sql :: postgresql delete multiple rows 
Sql :: declare varchar sql server 
Sql :: oracle sql copy table without data 
Sql :: sql cast 
Sql :: get cpu details sql 
Sql :: how to import pymysql through jupyter notebook for windows 
Sql :: how to remove unique key in mysql 
Sql :: oracle alter table add column default value 
Sql :: sql not in 
Sql :: replace divide by zero error with 0 in sql 
Sql :: install latest mysql 8 linux server 
Sql :: show table info mysql 
Sql :: mysql random 
Sql :: sql sequence 
Sql :: run function in sql 
Sql :: how to tun mysql on ubunto 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =