How can I delete MySQL temporary table?

MySQLMySQLi Database

As we know that MySQL temporary table would be deleted if the current session is terminated. But of still in between the session we want to delete the temporary table than with the help of the DROP statement we can delete the temporary table. It can be understood with the help of the following example −

Example

In this example, we are deleting the temporary table named ‘SalesSummary’ −

mysql> DROP TABLE SalesSummary;
Query OK, 0 rows affected (0.00 sec)

The above query will delete the table and it can be confirmed from the query below −

mysql> Select * from SalesSummary;
ERROR 1146 (42S02): Table 'query.SalesSummary doesn't exist
raja
Published on 22-Feb-2018 09:41:32
Advertisements