📅  最后修改于: 2022-03-11 15:05:18.034000             🧑  作者: Mango
DECLARE @Email VARCHAR(50) = 'helper@sql-server-helper.com'
SELECT SUBSTRING(@Email, 1, CHARINDEX('@', @Email) - 1) AS [User Name],
SUBSTRING(@Email, CHARINDEX('@', @Email) + 1, LEN(@Email)) AS [Domain Name]