How to get a substring from a formatted string

前端 未结 3 1102
面向向阳花
面向向阳花 2021-01-29 09:57

I would like to get a substring 403162 from the given string Praveen(403162) in sql?

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-29 10:49

    SELECT SUBSTRING(column_name, CHARINDEX('(', column_name)+1, CHARINDEX(')', column_name)-CHARINDEX('(', column_name)-1) from table_name
    

    DEMO

提交回复
热议问题