Oracle create table using with clause

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

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

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-01 03:46

    For multiple CTE (common table expressions; i.e. multiple WITH clause), I found the same syntax worked. i.e.

    
    CREATE TABLE schema.table_name as 
    WITH table1 as (SELECT 1),
    table2 as (SELECT 2)
    
    select * from table2
    
    

    will create the table_name in the schema from the select statement

提交回复
热议问题