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: How would I....

Re: How would I....

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Mon, 3 Dec 2001 22:56:05 -0000
Message-ID: <9uh031$g5$1@news7.svr.pol.co.uk>

select case(when substr(name,1,1) between '0' and '9' then 'LOT '||name else name)
from ...

"Jon Bon Jovi" <jon_at_bon.com> wrote in message news:3C0BFBDD.4ADDD91D_at_bon.com...
> Take the first letter of a varchar2 column and determine if it's
> a char or a number?
> ie.
>
> select decode(substr(name,1,1),<IF STRING>,name,'LOT '||name) from table
>
> If the first char of the name column is a string then just use the name
> column, otherwise
> concatenate the word 'LOT ' to the beginning of the column.
>
> Thanks.
>
>
>
>
>
Received on Mon Dec 03 2001 - 16:56:05 CST

Original text of this message

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