Archive

Posts Tagged ‘query’

Get all days between two dates in oracle sql

March 30, 2017 Leave a comment
select to_date('30-03-2017','dd-mm-yyyy') + rownum -1
from all_objects
where rownum <= to_date('30-04-2017','dd-mm-yyyy')-to_date('30-03-2017','dd-mm-yyyy')+1;
Categories: Oracle, Programación, SQL

Split string in sql query – oracle

October 3, 2016 Leave a comment

select regexp_substr('MyString,otherString,lastOneStr','[^,]+', 1, level) from dual
connect by regexp_substr('MyString,otherString,lastOneStr', '[^,]+', 1, level) is not null;

–Result :
———-
–MyString
–otherString
–lastOneStr

Categories: Beyond, Mini-tips, Oracle, SQL