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!

Nvl and Index

431495Feb 9 2005 — edited Feb 10 2005
Hi,
I have a table with columns col1, col2, col3.
and index on col1.
i want to know whehter the index will be used when i use the function NVL on that column...
i mean...which of the following works better...and in which query the index on col1 is used(if at all)...
1 select *
from table
where NVL(col1,col2) = col2


2 select *
from table
where (col1 = col2 or col1 is null)

thanks in advance.
with regards
Adarsh.P
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2005
Added on Feb 9 2005
22 comments
5,233 views