Temporary Tables : Temporary Table « Table « MySQL Tutorial






Temporary tables are fleeting in nature lasting only for the length of the MySQL session.

The syntax for creating temporary tables is:

CREATE TEMPORARY TABLE <table> (
      field definitions
 );
mysql>
mysql> CREATE TEMPORARY TABLE temp (
    ->      id int
    -> );
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> show tables;
Empty set (0.00 sec)

mysql>
mysql> drop TEMPORARY TABLE temp;
Query OK, 0 rows affected (0.00 sec)








4.8.Temporary Table
4.8.1.Temporary Tables
4.8.2.Using a query to create the temporary table