Get everything after and before certain character in SQL Server

前端 未结 15 1968
臣服心动
臣服心动 2020-12-07 18:48

I got the following entry in my database:

images/test.jpg

I want to trim the entry so I get: test

So basically, I want

15条回答
  •  广开言路
    2020-12-07 19:21

    SELECT SUBSTRING('ravi1234@gmail.com',1,(CHARINDEX('@','ravi1234@gmail.com')-1)) Before, RIGHT('ravi123@gmail.com',(CHARINDEX('@','ravi123@gmail.com')+1)) After

提交回复
热议问题