How to clear character is find first of string in SQL Server column? -


i'm beginner in sql server, have value in table column:

98123456789 54782012 

i want write query find first string if '98' true delete first string, example value this:

98123456789   ----> starts 98 start clear  result ====> 123456789 54782012      ----> not start 98 not clear result ===> 54782012 

how can write query purpose?

update [table] set column= case left(column, 2)   when '98' right(column,3)  else column end 

if column of integer type, replace right... cast(right(column,3) int)


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -