Rnet Rnet - 1 month ago 18
SQL Question

Oracle create table using with clause

Can I create a table from a query formed using

with
clause?

Answer

Sure:

CREATE TABLE t
AS 
WITH some_data AS ( 
   SELECT 1 as some_value 
   FROM dual

   UNION ALL 

   SELECT 2 
   FROM dual
) 
SELECT * 
FROM some_data
Comments