Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: basic sql help please
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
![]() |
![]() |