Create a TEMPORARY TABLE; : Temporary Table « Table Index « SQL / MySQL






Create a TEMPORARY TABLE;

     


CREATE TABLE fullauthors (
  authName varchar(60),
  authID int(11)
);



INSERT INTO fullauthors VALUES ('Asimov Isaac',62),
                                 ('Atwood Margaret',66),
                                 ('Bear Greg',67);
                                 
                                 
CREATE TEMPORARY TABLE tmp
SELECT authID, authName FROM fullauthors WHERE authID<20;


drop table fullauthors;

   
    
    
    
    
  








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.Duplicate table name between normal table and temporary table
8.Memory engine for temporary table