Skip to content
Advertisement

MySQL: Create table from select with engine different from source table

I would like to copy an existing table data to a new table with a different engine:

But it prompts syntax error. I know I can write the following statements as a workaround:

I am just wondering if there’s a statment that can copy an existing table data to a new table with a different engine, in just one SQL statement (MySQL or MariaDB variant statements are also okay). Thanks!

Advertisement

Answer

You can use next syntax:

MariaDB fiddle

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement