Home » SQL & PL/SQL » SQL & PL/SQL » select statement help? (oracle sql)
select statement help? [message #331123] Wed, 02 July 2008 05:57 Go to next message
MarkGwilliam
Messages: 2
Registered: February 2008
Junior Member
Hello - I have table A and table B.
I want to display records from table A, ONLY when a corresponding record does NOT exist in table B.

For example
Select A.name
from tableA A, tableB B
where A.id = B.id
and ?????

can anyone help? thanks M.
Re: select statement help? [message #331127 is a reply to message #331123] Wed, 02 July 2008 05:58 Go to previous messageGo to next message
NewLife
Messages: 170
Registered: April 2008
Senior Member
Try "minus"
Re: select statement help? [message #331128 is a reply to message #331123] Wed, 02 July 2008 05:59 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Use Minus

kanish
Re: select statement help? [message #331130 is a reply to message #331123] Wed, 02 July 2008 06:00 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
You yourself have the given the answer for your question. Read your question and search for the keyword which you think will suit your purpose and search in the oracle reference manual. Having said that there are different ways of doing it. Post some more details like

a) What is the size of your table
b) Columns which you join are they nullable
c) Version of your oracle
d) Last but not least follow the guidelines before you post.

ERgards

Raj
Re: select statement help? [message #331510 is a reply to message #331130] Thu, 03 July 2008 13:00 Go to previous messageGo to next message
mandeepmandy
Messages: 79
Registered: May 2008
Location: USA
Member

Select name
from tableA
minus
Select name
from tableB
Re: select statement help? [message #331511 is a reply to message #331123] Thu, 03 July 2008 13:07 Go to previous message
BlackSwan
Messages: 25041
Registered: January 2009
Location: SoCal
Senior Member
mandeepmandy,

Why are you re-posting previously provided responses?
Previous Topic: commit interval after delete
Next Topic: Pls help in writing query
Goto Forum:
  


Current Time: Tue Dec 06 10:34:02 CST 2016

Total time taken to generate the page: 0.07540 seconds