Duplicate table name between normal table and temporary table : Temporary Table « Table Index « SQL / MySQL






Duplicate table name between normal table and temporary table

     
mysql>
mysql> CREATE TABLE TESTTABLE (C1 INTEGER)
    -> ;

mysql> INSERT INTO TESTTABLE VALUES (1)
    -> ;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE TEMPORARY TABLE TESTTABLE (C1 INTEGER, C2 INTEGER)
    -> ;
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO TESTTABLE VALUES (2, 3)
    -> ;
Query OK, 1 row affected (0.00 sec)

mysql> SELECT * FROM TESTTABLE;
+------+------+
| C1   | C2   |
+------+------+
|    2 |    3 |
+------+------+
1 row in set (0.00 sec)

mysql>
mysql> drop table testtable;
Query OK, 0 rows affected (0.00 sec)

mysql>

   
    
    
    
    
  








Related examples in the same category

1.Using Temporary Tables
2.Give ordinary users the ability to lock (LOCK) tables, create temporary tables, and execute stored procedures.
3.Copying to a Temporary Table
4.Creating Temporary Tables
5.A temporary table can be created by adding the keyword TEMPORARY to the CREATE TABLE statement:
6.CREATE TEMPORARY TABLE
7.Memory engine for temporary table
8.Create a TEMPORARY TABLE;