Nun, das ist vielleicht zu stark vereinfacht, aber hey – das legen Ihre Beispieldaten nahe. Die Idee ist:Tabellennamen austauschen, keine Daten. Schau mal:
SQL> create table naveen_t1 (id number, name varchar2(20));
Table created.
SQL> create table naveen_t2 (id number, name varchar2(20));
Table created.
SQL> insert all
2 into naveen_t1 values (1, 'GOLDI')
3 into naveen_t1 values (2, 'NAVEEN')
4 into naveen_t1 values (3, 'AMIT')
5 --
6 into naveen_t2 values (1, 'RANJAN')
7 into naveen_t2 values (2, 'SOM')
8 into naveen_t2 values (3, 'ABHAY')
9 select * from dual;
6 rows created.
SQL> select * From naveen_t1;
ID NAME
---------- --------------------
1 GOLDI
2 NAVEEN
3 AMIT
SQL> select * From naveen_t2;
ID NAME
---------- --------------------
1 RANJAN
2 SOM
3 ABHAY
Hier geht's zum Trick :
SQL> rename naveen_t2 to temp;
Table renamed.
SQL> rename naveen_t1 to naveen_t2;
Table renamed.
SQL> rename temp to naveen_t1;
Table renamed.
SQL> select * from naveen_t1;
ID NAME
---------- --------------------
1 RANJAN
2 SOM
3 ABHAY
SQL> select * From naveen_t2;
ID NAME
---------- --------------------
1 GOLDI
2 NAVEEN
3 AMIT
SQL>