Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make a copy of a table in MySQL?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 208
    Comment on it

    To make a copy of a table in MySQL you need to execute the following statement:

    use databasename;
    Create table new_table_name
    select * from existing_table_name
    where conditions
    

    For example:

    We have database demo having table1. We required to create a table that is the copy of table1 and named it as table2. Following are statement you need to execute:

    use demo;
    Create table table1
    select * from table2
    

    Suppose you need the copy of the data based on some conditions:

    use demo;
    Create table table1
    select * from table2
    where colname='value';
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: