Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> sql

sql

From: <daud11_at_hotmail.com>
Date: Mon, 04 Oct 1999 09:56:28 GMT
Message-ID: <7t9tka$n5p$1@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 - 04:56:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US