Tuesday 13 December 2011

SELECT INTO

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


OrderNo
custname
city
1
Siva
Srivilliputtur
2
Bala
Sivakasi
3
Kanna
Madurai



Example :


select * into CopyPUr from Pur where custname='Bala'





0 comments:

Post a Comment

Followers

Powered by Blogger.