Home » SQL & PL/SQL » SQL & PL/SQL » to get common records (oracle 11g)
to get common records [message #576916] Sun, 10 February 2013 12:06 Go to next message
swapnabpnn
Messages: 96
Registered: December 2010
Member
Hi,
I have a situation as follows.
Table1 has 10 columns as col1,col2,col3,col4,...col10
Table2 has 5 columns as col1,col2,...col5.

col3 and col4 are common in both tables.I am trying to get common records from both tables.How can I get them.

Thanks
Re: to get common records [message #576917 is a reply to message #576916] Sun, 10 February 2013 12:17 Go to previous messageGo to next message
BlackSwan
Messages: 22783
Registered: January 2009
Senior Member
SELECT ONE.COL3, TWO.COL4
FROM TABLE1 ONE, TABLE2 TWO
WHERE ....

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: to get common records [message #576918 is a reply to message #576916] Sun, 10 February 2013 12:25 Go to previous messageGo to next message
Michel Cadot
Messages: 59105
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select ... from table1
intersect
select ... from table2

Regards
Michel
Re: to get common records [message #577123 is a reply to message #576918] Tue, 12 February 2013 09:39 Go to previous message
swapnabpnn
Messages: 96
Registered: December 2010
Member
Thanks..
Previous Topic: Partition Creation
Next Topic: Partition Creation based on other table values
Goto Forum:
  


Current Time: Wed Sep 17 06:55:29 CDT 2014

Total time taken to generate the page: 0.09273 seconds