📌  相关文章
📜  从电子邮件地址获取用户名和域名 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:18.034000             🧑  作者: Mango

代码示例1
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]