Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sql
create or replace view myview as
select col1, col2, decode(col2,0,0,(col1/col2)*1000000) col3
from mytable
--
Regards
Michel
<daud11_at_hotmail.com> a écrit dans le message : 7t9tka$n5p$1_at_nnrp1.deja.com...
> Hi
>
> I need to create a view where the code looks something like below.
>
> create or replace view myview as
> select col1, col2, (col1/col2)*1000000 col3
> from mytable
>
> However, it is possible that col2 contains some zero values and when
> there zeroes the view will break. I want col3 (calculated) to be 0 when
> col2 is 0. How do I change the sql to do just that with using UNION?
>
> Thanks
> Daud
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon Oct 04 1999 - 06:43:36 CDT
![]() |
![]() |