Create table (structure) from existing table

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

    1. If you Want to copy Same DataBase

      Select * INTO NewTableName from OldTableName
      
    2. If Another DataBase

      Select * INTO NewTableName from DatabaseName.OldTableName
      

提交回复
热议问题