The SQL SELECT INTO Statement
SELECT INTO Syntax:
Copy all columns into a new table:
SELECT *
INTO newtable [ IN externaldb]
FROM oldtable
WHERE condition;
Copy only some columns into a new table:
SELECT column1,column2,column3...
INTO newtable [ IN externaldb]
FROM oldtable
WHERE condition;
SQL SELECT INTO Examples
The following SQL statement creates a backup copy of employee:
SELECT * INTO employeeCopy
FROM employee;
SELECT * INTO employeeCopy IN 'Copy.mdb'
FROM employee;
SELECT Employee_name,Address INTO employeeCopy
FROM employee;
SELECT * INTO employeeIndia FROM employee
WHERE Country = 'India' ;
SELECT employee.Employee_name,products.Products_id INTO employee_product_Copy
FROM employee
LEFT JOIN products ON employee.Employee_id = products.Employee_id;