Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

'!= condition does not use index'

gonzromanMar 29 2010 — edited Apr 2 2010
I have query with a condition 'A<>B'; where A=1 and B=2. Both of this columns have an index but it's not being used because of the '!=' condition.

How can I rewrite the condition so that it will utilize the index. I'm thinking of this: '((a<b AND b>a) OR (b<a and a>b))'. Do you think it has the same output?

Thanks in advance for the response.

Edited by: gonzroman on Mar 29, 2010 8:03 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2010
Added on Mar 29 2010
12 comments
4,006 views