Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle list dates between

-- Oracle: List of last dates
SELECT trunc(sysdate - ROWNUM) AS CAL_DATE
FROM DUAL
CONNECT BY ROWNUM < 30;
Comment

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 list days 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 :: like in postgresql 
Sql :: sql find leading space 
Sql :: postgres create multiple index 
Sql :: change schema in sql server 
Sql :: convert html to plain text in sql server 
Sql :: generate random & unique mysql string 
Sql :: smallint sql 
Sql :: sql query inner join 3 tables 
Sql :: sqlite copy table to another table 
Sql :: sql tabelle erstellen 
Sql :: mysql not starting in xampp 
Sql :: tsql pad left 
Sql :: sql server on mac m1 
Sql :: on update current_timestamp jpa 
Sql :: php delete database 
Sql :: remove root password mysql 
Sql :: datagrip execute procedure 
Sql :: mysql two joins 
Sql :: mariadb create view 
Sql :: google cloud sql postgres url example 
Sql :: order by sql query 
Sql :: Split JSON data in SQL Server column 
Sql :: sql left join with where clause 
Sql :: sql count() 
Sql :: get only one row in mysql 
Sql :: first mysql 
Sql :: sql use with to get value counts and percentages 
Sql :: get from database the most recent data limit by 5 
Sql :: subquery in mysql 
Sql :: psql concat string and int 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =