我有这种情况:
John Doe johndoe@email.com
John johndoe@email.com
我想要的只是解析如下:
John Doe
John
换句话说,仅删除电子邮件地址。
我试过这个:
SELECT
(CASE WHEN CHARINDEX(‘ ‘, REVERSE(column1)) > 0 THEN Left(column1, CHARINDEX(‘ ‘, REVERSE(column1)) – 1)
ELSE column1
END) AS column1
FROM Book1