The SQL SELECT INTO statement is used to select data from a SQL database table
and to insert it to a different table.
Syntax :
we can select only the columns we want into the new table:
SELECT Column1, Column2, Column3,
INTO Table2
FROM Table1
We can select all columns into the new table:
SELECT *
INTO Table2
FROM Table1
The "Pur" Table
Example :
select * into CopyPUr from Pur where custname='Bala'
Syntax :
we can select only the columns we want into the new table:
SELECT Column1, Column2, Column3,
INTO Table2
FROM Table1
We can select all columns into the new table:
SELECT *
INTO Table2
FROM Table1
The "Pur" Table
OrderNo
|
custname
|
city
|
1
|
Siva
|
Srivilliputtur
|
2
|
Bala
|
Sivakasi
|
3
|
Kanna
|
|
Example :
select * into CopyPUr from Pur where custname='Bala'