Temporary table in Mysql

Home / Temporary table in Mysql

We can create temporary table in mysql with TEMPORARY keyword , here TEMPORARY  keyword is case insensitive  ,you can use TEMPORARY  or  temporary  ,  use below command to create temporary table

create TEMPORARY table javadream (id int ,name varchar(20), primary key (id));

After above command use describe javadream  command this will show you description of your temporary javadream table

Now Just insert data like you insert data in simple tables

insert into javadream values(1,”javadream”);

Note:  You can access the temporary table until you have the current session if you close the session and open mysql again and try to select the data from temporary table you ‘ll get error like

ERROR 1146 (42S02): Table ‘revelivebackup.javadream’ doesn’t exist


Help Others, Please Share

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *