In Oracle, we can use "create table as select" as shown below.
1. Copy table into a new table.
create table tbl_x as select * from tbl_test;
2.Create a new empty table with the same structure.
create table tbl_y as select * from tbl_test where 2=1;
In SQL Server, we can use select into as shown below.
1. Copy table into a new table.
select * into tbl_x from tbl_test ;
2. Create a new empty table with the same structure.
select * into tbl_y from tbl_test where 2=1;
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.