How to trim everything after certain character in sql

前端 未结 2 1600
长情又很酷
长情又很酷 2021-01-12 02:25

I am trying to format the email address in my table by removing everything starting the @. Also I would like to replace the underscore with blank space.

For exampl

2条回答
  •  长情又很酷
    2021-01-12 03:19

    SELECT REPLACE(LEFT(Email, CHARINDEX('@',Email)-1),'_',' ')
    FROM [DSR].[dbo].[RCA_Dashboard]
    

提交回复
热议问题