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

Home -> Community -> Usenet -> c.d.o.misc -> Re: basic sql help please

Re: basic sql help please

From: Brian E Dick <bdick_at_cox.net>
Date: Mon, 25 Nov 2002 21:45:03 GMT
Message-ID: <zRwE9.24422$wc2.1095780@news2.east.cox.net>


You can do it with numbers, too.

update table
set phonenum = phonenum - 4010000000 + 6170000000 where phonenum between 4010000000 and 4019999999

"Deuce" <rick_at_ricks-web.info> wrote in message news:uu4vivmm77603f_at_news.supernews.com...
> > Use SUBSTR. Hopefully you have defined the phone number column as
> > varchar2 rather than number. Columns which always contain numeric data
> > should still be defined as varchar2 if you're not ever going to be using
> > them in calculations, and I can't imagine what calculations anyone would
> > ever want to do with phone number. Anyway you can
> >
> > UPDATE table
> > SET phonenum = 'xxx'||SUBSTR(phonenum,4)
> > WHERE SUBSTR(phonenum,1,3) = 'yyy';
> >
>
> This worked like a charm. I was using numbers, but using TO_CHAR worked
out.
>
> Thanks!
>
>
Received on Mon Nov 25 2002 - 15:45:03 CST

Original text of this message

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