SQLTeam.com | Weblogs | Forums

Replace values


#1

I am new to SQL and need your help to replace the values in a column with a new value in the same column as below example

Column1 new value Column1
A1 K0A1
A2 K0A2
A222 K0A222
. .
. .
. .
. .

how can i do it?

Thanks for help


#3
Select 'K0'+Column1 as [New Value Column1]
from yourtable

#4
select stuff(Column1,1,0,'K0') as [New Value Column1]
from yourtable

#5

Hello,
thanks for help. it works with this code:
update st set ref=(
Select 'K0'+ref as [ref]
)
from st