Temporary table in Mysql
April 5, 2018 | Spring boot complete tutorial with example | No Comments
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