'!= condition does not use index'
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