Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Generating Binary Column
Use the sign(x-5) construct in your decode.
Hth,
Sybrand Bakker, Oracle DBA
<nevergiveup_at_my-deja.com> wrote in message
news:967b2j$ssd$1_at_nnrp1.deja.com...
> Hello,
>
> I have Table T with Column X.
> I want to generate Column Y in the same table, or in the new view V.
>
> I want Y to have the value of 1 if X >= 5, and 0 if otherwise.
>
> How would I do this?
> I have been looking into Decode, and it doesn't seem to do it.
> I think Decode only works for text matching.
>
> Thank you,
>
> Gingko
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Sun Feb 11 2001 - 23:12:43 CST