Skip to navigation
How to find the last substring occurrence by a separator with mssql
06.01.17
example: find all substrings after the last dash - drop table #colors SELECT TOP 1000 [pics_pic_code] ,RIGHT( pics_pic_code, CHARINDEX( '-', REVERSE( pics_pic_code ) + '-' ) - 1 ) AS code INTO #colors FROM [SL].[dbo].[pics_pic_table] where pics_pic_code like '%-%'
http://www.sqlservercentral.com/Forums/Topic693069-338-1.aspx
Reply
Anonymous
Information Epoch 1753273764
Silence is golden.
Home
Notebook
Contact us