Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to select 0 as null
Might be better to do:
select
decode( column_name, 0, to_number(null), column_name )
from t
;
other wise the column is coerced into a varchar2() column, and then anything you do to treat it as a number will require it to be coerced back to a number, so every row will have the overhead of one decode() one to_char() and one to_number() call.
Insignificant if the number of rows is only the odd hundred thousand, but could chew up some CPU when the data size becomes significant.
--
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
Thomas Kyte wrote in message <37a77fbe.100930670_at_newshost.us.oracle.com>...
>
>select decode( column_name, 0, null, column_name )
> from t
>/
Received on Fri Jul 23 1999 - 10:06:10 CDT
![]() |
![]() |