Create table (structure) from existing table

后端 未结 15 1406
遇见更好的自我
遇见更好的自我 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:13

    try this.. the below one copy the entire structure of the existing table but not the data.

    create table AT_QUOTE_CART as select * from QUOTE_CART where 0=1 ;
    

    if you want to copy the data then use the below one:

    create table AT_QUOTE_CART as select * from QUOTE_CART ;
    

提交回复
热议问题