Logo Background RSS

» mysql commands

  • Copying a Table
    By on March 4th, 2009 | 1 Comment1 Comment Comments

    /*create a copy of a table so that you
    can alter it or experiment with it without endangering the original
    data
    */

    CREATE TABLE new_table_name
    SELECT * FROM old_table_name;

    /* Differences: their names,
    if the old table had an index (or key), it
    does not transfer to the new table.
    only two columns chosen
    */