-4

I have some car model and I want them to replace with other random number.

KMAL
UT
NC
WI
KMMA
KMKS
MA
MI
KMNJ
KMAR
TN
NH
AK
OK
KMWA
KMNY
KMMI
KY

I want these to be replaced with some other random name. I can either run the below query each time to replace, but it is time consuming.

update 
  table
set column=REPLACE(column, 'KMAL', 'LAMK')

Any other way I can do it in one go.

AK47
  • 3,707
  • 3
  • 17
  • 36
user3069018
  • 35
  • 1
  • 1
  • 5

1 Answers1

1

You could nest the replace function

update table set column=REPLACE(REPLACE(column, 'KMAR', 'RAMK'), 'KMAL', 'LAMK')

Rohit Chaudhari
  • 757
  • 3
  • 14
  • 33