Oracle SQL inserir na cláusula With
Eu sou novo no sql, então talvez seja uma pergunta idiota, mas existe alguma possibilidade de usar a cláusula With com Insert Into? Ou existem soluções alternativas comuns? Quero dizer algo como isto:
With helper_table As (
Select * From dummy2
)
Insert Into dummy1 Values (Select t.a From helper_table t Where t.a = 'X' );
THX
Meu exemplo é muito fictício, então adiciono um código estendido (thx para as respostas até agora
INSERT
INTO dummy values (a,b) //more values
WITH helper_table AS
(
SELECT *
FROM dummy2
)
WITH helper_table2 AS //from more tables
(
SELECT *
FROM dummy3
)
SELECT t.value as a, t2.value as b
FROM helper_table t
join helper_table t2 on t.value = t2.value //some join
WHERE t.value = 'X' and t2.value = 'X' //other stuff