Knowledge Walls
John Peter
Pune, Maharashtra, India
How to copy table with constraints in mysql?
8912 Views
Creating a new table by existing table with constraints.
Example
-- To copying table with constraints
CREATE TABLE new_table_name LIKE old_table_name;

-- To copying without constraints
CREATE TABLE new_table_name
(SELECT * FROM old_table_name WHERE 0);
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details