Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Query Help
4DAirlines wrote:
> This is probably basic, but I can't figure it out...
> I need to run this query, and I have to keep commenting out each line,
> and then run it, then comment out the line and run the next one. Is
> there a way to write this query so that I can just run it once, and it
> will update the column all in one go, using 'AND', or something? This
> is my first post, please be gentle...!
>
>
> update table1
> set fbc = 'j' where fbc = 'c'
> --set abc = 'jw' where abc = 'cw'
> --set abc = 'jx' where abc = 'cx'
> --set abc = 'y' where abc = 'y'
> --set abc = 'yce' where abc = 'yce'
> --set abc = 'bce' where abc = 'bce'
> etc.
assuming that fbc = abc:
update table1
set abc = decode(abc,
'c', 'j', 'cw', 'jw', 'cx', 'jx', ...., abc)
or (if U want to avoid trivial updates)
update table1
set abc = decode(abc,
'c', 'j', 'cw', 'jw', 'cx', 'jx', ....)
Matthias Received on Fri Jan 24 2003 - 09:40:09 CST
![]() |
![]() |