Home » SQL & PL/SQL » SQL & PL/SQL » How To comapre The Two Table? (merged)
How To comapre The Two Table? (merged) [message #322366] Fri, 23 May 2008 04:52 Go to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
SQL> desc t1;
Name Type Nullable Default Comments
---- ------------- -------- ------- --------
A NUMBER(38) Y
B VARCHAR2(100) Y

SQL> desc t11;
Name Type Nullable Default Comments
---- ------------- -------- ------- --------
A NUMBER(38) Y
B VARCHAR2(100) Y

SQL> select * from t1;

A B
--------------------- ------------------------------------------
1 hello
3 hello3
4 hello4
5 hello8
8 hello8

SQL> select * from t11;

A B
--------------------- -----------------------------------------
1 hello
2 hello2
3 hello3
4 hello4
5 hello5


Now I want To perform an following operation in table t11
as

1)i want to delete the values which is not in t1
2)i want to update which has been updates in t1
3)i want to delete the records which has been delete in t1


how Can we do this?


Pls help me.........
Re: How To comapre The Two Table? [message #322369 is a reply to message #322366] Fri, 23 May 2008 05:01 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
how Can we do this?

Using SQL.

Post what you already tried and why it does not fit the requirements (if it does not).

Also please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.

You will a better chance to get answer if you post a test case (create table and insert statements).

Regards
Michel
Re: How To comapre The Two Table? [message #322374 is a reply to message #322369] Fri, 23 May 2008 05:12 Go to previous messageGo to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
SQL> desc t1;
Name Type Nullable Default Comments
---- ------------- -------- ------- --------
A NUMBER(38) Y
B VARCHAR2(100) Y

SQL> desc t11;
Name Type Nullable Default Comments
---- ------------- -------- ------- --------
A NUMBER(38) Y
B VARCHAR2(100) Y

SQL> select * from t1;

A B
--------------------- ------------------------------------------
1 hello
3 hello3
4 hello4
5 hello8
8 hello8

SQL> select * from t11;

A B
--------------------- -----------------------------------------
1 hello
2 hello2
3 hello3
4 hello4
5 hello5


Now I want To perform an following operation in table t11
as

1)i want to delete the values which is not in t1
2)i want to update which has been updates in t1
3)i want to delete the records which has been delete in t1


how Can we do this?


Pls help me.........
Re: How To comapre The Two Table? [message #322379 is a reply to message #322374] Fri, 23 May 2008 05:19 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member

http://forums.oracle.com/forums/thread.jspa?threadID=659916&tstart=0

Regards

Raj
Re: Urgent Help Pls [message #322389 is a reply to message #322366] Fri, 23 May 2008 05:56 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
This is way too complicated to be done in sql. So you need to ask this question atleast another n times in all the possible oracle forums to get an answer.

Good luck and I am very glad that you have chosen a very helpful title.

Regards
Re: Urgent Help Pls [message #322392 is a reply to message #322366] Fri, 23 May 2008 06:14 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is useless to multiply the same post, above breaking the rules.

Read and follow OraFAQ Forum Guide.

Regards
Michel

[Edit:] correction it is not useless, it is counter-productive.

[Updated on: Fri, 23 May 2008 06:18]

Report message to a moderator

Previous Topic: How to write a delete procedure?
Next Topic: uutl_file error
Goto Forum:
  


Current Time: Sat Dec 10 04:58:44 CST 2016

Total time taken to generate the page: 0.30596 seconds