如果您想复制数据:
INSERT INTO newTable (col1, col2)
SELECT col1, col2 FROM otherTable
如果要复制表结构:
Use LIKE to create an empty table based on the definition of another table, including any column attributes and indexes defined in the original table:
06001
The copy is created using the same version of the table storage format as the original table. The SELECT privilege is required on the original table.
如果要复制结构和数据:
CREATE TABLE animals2 AS
SELECT *
FROM animals ;
如果你想复制没有数据的结构(但不是所有列):
CREATE TABLE animals2 AS
SELECT animal -- only the columns you want
FROM animals
WHERE FALSE; -- and no data