Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: using SQL TRIM
In article <3B49C0A6.D13A3F98_at_sympatico.ca>, lance says...
>
>if I use SQL command TRIM in a query...will the query still use the
>indexes?
>
Depends.
if you have a
table t ( c varchar2(25) )
and and
index t_idx on t(c)
and go:
select * from t where c = trim( :x );
that'll be able to use the index, however,
select * from t where trim(c) = 'some value'
will not be able to use that index but it could use the index:
index t_idx on t(trim(c));
see
http://osi.oracle.com/~tkyte/article1/index.html
for an overview of function based indexes -- the ability to create an index on
the trim(c).
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Mon Jul 09 2001 - 14:47:53 CDT
![]() |
![]() |