Extract number from day in pl sql

Does anyone know if it is possible to take a date from a random date in pl sql.

Example.

SELECT SYSDATE FROM DUAL

and here the result will be displayed: 26-10-2010 13:30:34

Now I want to have only a date as a number. In this case, it will be 26.

Or there is some kind of function like IsNum that can recognize it for me. So I can just take 26 and leave the rest.

+3
source share
5 answers
select to_char(sysdate,'DD') as day from dual
+5
source

You can also use EXTRACT(), for example:

SELECT EXTRACT(DAY FROM SYSDATE) AS DAY FROM DUAL;
+10
source

to_char(SYSDATE, 'DD')

:

+4
+3
select count(*) from 
     (select sysdate+rownum dates from  dual connect by rownum < (sysdate+15)-(sysdate))  
   where to_char(dates,'D') <> '1' and to_char(dates,'D') <> '7'
+1

Source: https://habr.com/ru/post/1771497/


All Articles