trimming characters

declare @T table
  (
  Col varchar(20)
  )



  insert into @T
  Select 'WO-012345' --'images/test1.jpg'
  --union all
  --Select 'images/test2.png'
  --union all
  --Select 'images/test3.jpg'
  --union all
  --Select 'images/test4.jpeg'
  --union all
  --Select 'images/test5.jpeg'

 Select substring( col,charindex('-',Col)+1,6 )
from @T

Comments

Popular posts from this blog

Azure Data Fundamentals | DP-900 | what you need to know

Leetcode - Blind75 - P1 - Arrays

View or Configure the backup compression default Server Configuration Option