to_number question 2004-07-15 - By Jared.Still@(protected)
...
> 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
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected)
put 'unsubscribe ' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
|
|