Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
declare @Temp Float
Set @Temp = 93785542352
Select Convert(Float, Case When SubString(Convert(VarChar(20), Convert(BigInt, @Temp)), 3, 1) = '1'
Then Stuff(Convert(VarChar(20), Convert(BigInt, @Temp)),3, 1, '5')
When SubString(Convert(VarChar(20), Convert(BigInt, @Temp)), 3, 1) = '2'
Then Stuff(Convert(VarChar(20), Convert(BigInt, @Temp)),3, 1, '6')
Else Convert(VarChar(20), Convert(BigInt, @Temp))
End)
[COLOR=green]--set up test data
[/color][COLOR=blue]declare[/color] @t [COLOR=blue]table[/color] (tcol [COLOR=blue]varchar[/color](9))
[COLOR=blue]insert[/color] @t
[COLOR=blue]select[/color] 123456790
union all [COLOR=blue]select[/color] 12456799
union all [COLOR=blue]select[/color] 12156799
union all [COLOR=blue]select[/color] 12256799
[COLOR=green]--query to show replaced value, original value
[/color][COLOR=blue]select[/color] [COLOR=blue]case[/color]([COLOR=#FF00FF]substring[/color](tcol, 3, 1))
[COLOR=blue]when[/color] [COLOR=red]'1'[/color] [COLOR=blue]then[/color]
[COLOR=#FF00FF]stuff[/color](tcol, 3, 1, [COLOR=red]'5'[/color])
[COLOR=blue]when[/color] [COLOR=red]'2'[/color] [COLOR=blue]then[/color]
[COLOR=#FF00FF]stuff[/color](tcol, 3, 1, [COLOR=red]'6'[/color])
[COLOR=blue]else[/color] tcol [COLOR=blue]end[/color] [COLOR=blue]as[/color] Changed
, tcol [COLOR=blue]as[/color] Original
[COLOR=blue]from[/color] @t