temp 表名是不是Mysql的保留字?

解决方案 »

  1.   

    语法没有问题:是不是你的mysql版本过低,不支持temporary 表mysql> select * from table1;
    +-------+
    | tkey1 |
    +-------+
    |   101 |
    |   102 |
    |   103 |
    +-------+
    3 rows in set (0.00 sec)mysql> create temporary table temp select * from table1;
    Query OK, 3 rows affected (0.22 sec)
    Records: 3  Duplicates: 0  Warnings: 0mysql> select * from temp;
    +-------+
    | tkey1 |
    +-------+
    |   101 |
    |   102 |
    |   103 |
    +-------+
    3 rows in set (0.00 sec)
      

  2.   

    :)
    楼上有理,
    如果是 MySQL 3.23 以前的版本,不支持临时表