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 :: get value from a table an insert it with other values in another table sql 
Sql :: calculate age in sql postgresql 
Sql :: mysql how to store lat,lng 
Sql :: install mysql workbench ubuntu 20.04 
Sql :: mysql set id auto increment 
Sql :: change row in sql 
Sql :: grant all privileges on a db 
Sql :: copy postgres table from one schema into another 
Sql :: select row from mysql where date more than 30 days 
Sql :: select distinct 
Sql :: mysql error 1251 
Sql :: MySQL server is running with the –secure-file-priv 
Sql :: update with inner join postgres 
Sql :: oracle convert int to date 
Sql :: creating a table in sql 
Sql :: postgresql casting integer to string 
Sql :: sql_calc_found_rows 
Sql :: how to check the mysql version mac 
Sql :: 3 days back in sql server 
Sql :: t sql null or empty string 
Sql :: sql count 
Sql :: pl/sql procedure example 
Sql :: mysql to get column name in database 
Sql :: sql date format 
Sql :: joomla execute raw sql 
Sql :: RowDataPacket 
Sql :: copy value from one column to another postgres 
Sql :: get records in sql according to month name and count 
Sql :: create function syntax sql server 
Sql :: mysql json query 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =