Oracle create table using with clause

后端 未结 3 778
不知归路
不知归路 2021-02-01 03:32

Can I create a table from a query formed using with clause?

3条回答
  •  不知归路
    2021-02-01 03:59

    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
    

提交回复
热议问题