INSERT INTO table(columns...) with table_tmp as ( select ...) select...
709255Jun 29 2009 — edited Jun 29 2009Hi Guru,
Is below a valid SQL|PLSQL statement? or multiple statements and what it does?
insert into table(col1, col2, col3, col4)
with table_tmp as
(select ccol1, ccol2, ccol3, ccol4, ccol5, ccol6
from table1 t1, table2 t2
where t1.id=t2.id
and t2.start > sysdate()
)
select tcol1, tcol2, tcol3, tcol4
from table_tmp tt1, table3 t3
where tt1.id=tt3.id;
I checked the SQL quick reference and don't see anything similar to this... I wonder where can find a better syntax reference book.
Thanks in advance
kh