Answer the question
In order to leave comments, you need to log in
How to speed up table creation in ORACLE?
Good afternoon!
I'm trying to create a table, the code is as follows:
create table TAB_TMP
as
with date as
(select
trunc(sysdate) - level as d
from dual
where to_char(trunc(sysdate)-level,'d')='7'
or level = 1
or (trunc(sysdate)-level)=last_day(trunc(sysdate)-level)
connect by trunc(sysdate)-level >=
(select min(end_date) from TABLE1)
)
select d "DATE",
c.code "CODE",
a.id "ID",
a.amt "BALANCE"
from TABLE1 a
join dates b
on b.d between a.start_date and a.end_date
join TABLE2 c
on c.idx=a.idx
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question