如题!还有一个问题,就是怎么把同一数据库里的table1表的内容导入到table2中?

解决方案 »

  1.   

    RENAME TABLE tbl_name TO new_tbl_name
        [, tbl_name2 TO new_tbl_name2] ...This statement renames one or more tables. mysql> select version();
    +----------------------+
    | version()            |
    +----------------------+
    | 5.1.33-community-log |
    +----------------------+
    1 row in set (0.06 sec)mysql> create table sunyiqiao719 (id int,f int);
    Query OK, 0 rows affected (0.14 sec)mysql> show tables like 'sunyiqiao%';
    +-----------------------------+
    | Tables_in_csdn (sunyiqiao%) |
    +-----------------------------+
    | sunyiqiao719                |
    +-----------------------------+
    1 row in set (0.00 sec)mysql>
    mysql> RENAME TABLE sunyiqiao719 TO sunyiqiao718;
    Query OK, 0 rows affected (0.08 sec)mysql> show tables like 'sunyiqiao%';
    +-----------------------------+
    | Tables_in_csdn (sunyiqiao%) |
    +-----------------------------+
    | sunyiqiao718                |
    +-----------------------------+
    1 row in set (0.00 sec)mysql>
      

  2.   


    insert into table2 select * from table1;