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: help with decode

Re: help with decode

From: Noons <wizofoz2k_at_yahoo.com.au>
Date: Thu, 04 Aug 2005 00:54:13 +1000
Message-ID: <42f0da95$0$11951$5a62ac22@per-qv1-newsreader-01.iinet.net.au>


soup_or_power_at_yahoo.com apparently said,on my timestamp of 4/08/2005 12:28 AM:
> sybrandb_at_yahoo.com wrote:
>

>>The syntax is
>><string expression>||<string expression>
>>
>>No comma's.

>
>
> So the following are the same?
>
> SELECT (DECODE(a1, 'b1', a2, 'b2')) from A
>
> SELECT (DECODE(a1, 'b1 || a2, 'b2')) from A

No. the first is the syntax for a decode with 4 terms. the second is the syntax for a decode with three terms in which the second term is a concatenation, following the model Sybrand showed you above.

>
> Also if I use CHR(1) as follows what does it mean?
>
> SELECT (DECODE(a1, 'b1 || CHR(1) || a2, 'b2')) from A

It means you just concatenated a third string to the second term of your decode.

How's about using CASE instead?

-- 
Cheers
Nuno Souto
in sunny Sydney, Australia
wizofoz2k_at_yahoo.com.au.nospam
Received on Wed Aug 03 2005 - 09:54:13 CDT

Original text of this message

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