Home » SQL & PL/SQL » SQL & PL/SQL » About the query...
About the query... [message #289676] Tue, 25 December 2007 04:31 Go to next message
ziauldba
Messages: 55
Registered: January 2007
Location: Bangladesh
Member

dear friends..
I have two tables like...
table1
ID NAme
01 aaaa
02 bbbb
03 cccc

table2
id name address
02 bbb Comilla
05 ddd dhaka
06 asas Ctg

I want to see the table1 id and name who are not in table2
like----

id name
01 aaaa
03 cccc


thanks
Re: About the query... [message #289679 is a reply to message #289676] Tue, 25 December 2007 05:03 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
NOT EXISTS
This is a newbie question.
Generally speaking, given your knowledge, post your question in newbie forum, we'll move it to expert one if it is needed.

Regards
Michel
Re: About the query... [message #289692 is a reply to message #289679] Tue, 25 December 2007 08:49 Go to previous messageGo to next message
cgmsuresh
Messages: 29
Registered: December 2007
Location: http://maps.google.com/ma...
Junior Member

Use MINUS - SET OPERATOR.

select id,name from table1
MINUS
select id,name from table2

Gotcha!!!
Re: About the query... [message #289796 is a reply to message #289676] Wed, 26 December 2007 02:53 Go to previous message
spmano1983
Messages: 269
Registered: September 2007
Senior Member
Hi,

Try this and get back.

select * from table1 where (id,name) not in (select id,name from table2);

Mano

Previous Topic: Problem in doing group by in query
Next Topic: Unable to extend temp segment on tablespace
Goto Forum:
  


Current Time: Fri Dec 09 10:07:54 CST 2016

Total time taken to generate the page: 0.05330 seconds