dbTalk Databases Forums  

NOT EXISTS and NOT Operator

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss NOT EXISTS and NOT Operator in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
raja
 
Posts: n/a

Default NOT EXISTS and NOT Operator - 07-19-2012 , 08:36 AM






Hi All,

Can someone please help me on the below doubts in Oracle 8.1.7 :
1. How does NOT EXISTS and NOT Operator work in the below query. Its confusing, please explain me the functionality over here in detail?
2. since not exists is not recommended to be used and not operator too. please suggest me the list of methods that this query can be re-written to improve the query performance!!??

select
'value1', value2
from table2 t1
where t1.col2 = 'X'
and not exists
(
select null
from table2 t2
where
t2.col3 <> 'Y'
and t1.col1 = t2.col1
);

Thanks in Advance.

With Regards,
Raja.

Reply With Quote
  #2  
Old   
joel garry
 
Posts: n/a

Default Re: NOT EXISTS and NOT Operator - 07-19-2012 , 10:59 AM






On Jul 19, 6:36*am, raja <dextersu... (AT) gmail (DOT) com> wrote:
Quote:
Hi All,

Can someone please help me on the below doubts in Oracle 8.1.7 :
1. How does NOT EXISTS and NOT Operator work in the below query. Its confusing, please explain me the functionality over here in detail?
2. since not exists is not recommended to be used and not operator too. please suggest me the list of methods that this query can be re-written to improve the query performance!!??

select
'value1', value2
from table2 t1
where t1.col2 = 'X'
and not exists
(
select null
from table2 t2
where
t2.col3 <> 'Y'
and t1.col1 = t2.col1
);

Thanks in Advance.

With Regards,
Raja.
Please go to asktom.oracle.com and type NOT EXISTS in the search box.
Who says it is not recommended?

jg
--
@home.com is bogus.
There are legs in the tape market yet. http://www.theregister.co.uk/2012/07/19/oracle_sl150/

Reply With Quote
  #3  
Old   
Gerard H. Pille
 
Posts: n/a

Default Re: NOT EXISTS and NOT Operator - 07-20-2012 , 11:34 AM



joel garry wrote:
Quote:
Please go to asktom.oracle.com and type NOT EXISTS in the search box.
Who says it is not recommended?

A certain "raja", in the post you replied to.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.