How to copy a table in another table with datas?
Answers were Sorted based on User's Feedback
Answer / guest
If new table is not yet created,
create table new_table as select * from old_table;
if new table is already created,
insert into new table select * from old_table
provided the structure of the new table is same as old
table.
Is This Answer Correct ? | 21 Yes | 1 No |
Answer / guest
If new table is not yet created,
create table new_table as select * from old_table;
if new table is already created,
insert into new table select * from old_table
provided the structure of the new table is same as old
table.
Is This Answer Correct ? | 8 Yes | 0 No |
Answer / kavitha nedigunta
create table new_table as select * from old_table;
EG:- create table emp1 as select * from emp;
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / meher
copy from user_name/password@schema_name insert
target_table_name using select * from source_table_name;
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / monty
if you have a table employee you can create duplicate
record using into statement
select *into backup_employee from employee
the above statement create new table backup_employee with
same data of employee
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / mohan
create table emp_dup as select * from emp:
if we have already structure means:
Insert into emp_dup(select * from emp);
Is This Answer Correct ? | 2 Yes | 0 No |
In Oracle 10g :
---------------
Create New Table in another table with same data's:
---------------------------------------------------
copy from coeot1a2/coeot1a2@coeau to scott/tiger@coeau
CREATE s11 using select * from major_list;
Insert data's into another table with same data's:
---------------------------------------------------
copy from coeot1a2/coeot1a2@coeau to scott/tiger@coeau
INSERT s11 using select * from major_list;
Append data's into another table with same data's:
---------------------------------------------------
copy from coeot1a2/coeot1a2@coeau to scott/tiger@coeau
APPEND s11 using select * from major_list;
Replace data's into another table with same data's:
---------------------------------------------------
copy from coeot1a2/coeot1a2@coeau to scott/tiger@coeau
REPLACE s11 using select * from major_list;
Is This Answer Correct ? | 0 Yes | 0 No |
---With date from existing table to new table.
SQL> create table new_table_name as select * from old_table_name where 1=1;
---without data
SQL> create table new_table_name as select * from old_table_name where 1=2;
Thanks,
Is This Answer Correct ? | 0 Yes | 0 No |
How many types of database triggers can be specified on a table ? What are they ?
How the execution will be done in exceptions?
What is a variable in sql?
If I have a table T with 4 rows & 2 columns A & B. A has values 1,2,3,4. and B has 10,20,30,40. Write an Update SQL query which can Swap the values of A & B for all records. (Do not use a sub-query)
What is the criteria while applying index to any column on any table.
Can we join two tables without common column?
How to Declare Fixed Length String Value In PL SQL
Hello All, Could any well write a query for the following scenario. Account(table name) No Name Amount 1 ABCD 2000.00 2 DEFG -2000.00 3 GHIJ 3000.50 4 JKLM 4000.00 5 MNOP 6000.00 O/p Should be in this format No Name Credit Debit 1 ABCD 2000.00 0 2 DEFG 0 -2000.00 3 GHIJ 3000.50 4 JKLM 0 -4000.00 5 MNOP 6000.00 o could any one give appropriate query for this Thnks in Advance
What sql does db2 use?
Which constraints we can use while creating database in sql?
How many rows can sqlite handle?
Is it possible to update views?