Wednesday, May 4, 2011

How to insert the Records from one table to another

1.How to insert the records from one table to another?

ans:

 Here we have two options Directly inserting the Records from one table to another new table

1.SELECT COL1,COL2,COL3 INTO NEWTABLE FROM OLDTABLE
For above query one new table is created with new table name and all records on old table(table1)

2.INSERT INTO TABLE1(COL1,COL2,COL3) SELECT COL1,COL2,COL3 FROM TBALE2
It will insert the records of table2 into table1
we can use where condition also


No comments:

Post a Comment