Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Re[6]: to_number question
...
> If you write the original query as
>
> select x from t
> where decode(translate(col,'0123456789a','0123456789),null,'A','N') =
N
> and to_number(col) > const
>
> you immediately recognize that you may be in trouble because you
> know that you
> must not rely on the predicates being evaluated in the order they
> appear in the
> where clause. So now put the first predicate into a inline view thinking
that
> this way you impose a order of processing. Well, you don't. The
optimizer is
> allowed to transform your query "back" into its simpler form.
>
... which would seem to indicate that the operation in question should be
performed with a minimum of two queries and a temporary table.
Quite an interesting thread, one that forces you to realize that the
database
is not a 'black box': understanding is required.
Jared
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Thu Jul 15 2004 - 13:23:01 CDT
![]() |
![]() |