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

Home -> Community -> Usenet -> c.d.o.server -> Re: Creation of a column based on values of other columns, help please!

Re: Creation of a column based on values of other columns, help please!

From: T Suresh kumar <sureshkt_at_hotmail.com>
Date: Fri, 24 Apr 1998 16:22:10 +0530
Message-ID: <35406ED9.3730D7D@hotmail.com>


Hai

    Below query may help you.

    create view v1 as
    (select n1, n2 ,
decode(sign(n1),1,'true',-1,'true',decode(sign(n2),0,'false','true')) TF

     from table1)
/
Regards
Suresh Kumar

Mark Tortolano wrote:

> Hi, I want to create a View based on a table in Oracle. I've got two
> columns in the table with numeric values that indicate user
> preferences. I want to create a third column in this view that will
> have a true/false value that will be "true" if either of the other
> columns has a non-zero number in it.
>
> Is it possible to do this in SQL alone, perhaps using DECODE? Or would
>
> I have to use PL/SQL to create the view. If so, how?
>
> Thanks in advance,
>
> Mark Tortolano
>
Received on Fri Apr 24 1998 - 05:52:10 CDT

Original text of this message

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