Create table (structure) from existing table

后端 未结 15 1446
遇见更好的自我
遇见更好的自我 2020-11-27 13:46

How to create new table which structure should be same as another table

I tried

CREATE TABLE dom AS SELECT * FROM dom1 WHERE 1=2

bu

15条回答
  •  臣服心动
    2020-11-27 14:15

    If you want to create a table with the only structure to be copied from the original table then you can use the following command to do that.

    create table  as select * from  where 1>2;
    
    

    By this false condition you can leave the records and copy the structure.

提交回复
热议问题