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: Graham Miller <lgmiller_at_elmrd.u-net.com>
Date: Sat, 25 Apr 1998 07:58:25 GMT
Message-ID: <35429481.1492312@news.u-net.com>


gennick_at_worldnet.att.net (Jonathan Gennick) wrote (in <6hri7n$gh_at_bgtnsc03.worldnet.att.net>)...

| On Fri, 24 Apr 1998 09:57:31 GMT,
| mark_tortolano_at_dial.pipex.com (Mark Tortolano) wrote:
|

| DECODE(abs(nvl(col_1,0))+abs(nvl(col_2,0)),0,'F','T')
[snip]
| I'll be interested in seeing what other solutions people
| come up with for this.

It can also be done without 'decode' by using 'translate'. We also need to use the 'sign' function to reduce the range of returned values. However it is not as flexible as the decode solution. 'horrid' is one word i would use to describe it :)

 Translate( to_char( sign( abs(nvl(col_1,0))+abs(nvl(col_2,0) ) ) ) ,

                  '01',  'F'T' )

graham Received on Sat Apr 25 1998 - 02:58:25 CDT

Original text of this message

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