例如:电子邮件
sundar@gmail.com
larry@gmail.com
需要分隔为
column1 column2
sundar gmail.com
larry gmail.com
答案 0 :(得分:1)
以防mysql
SELECT
SUBSTRING_INDEX('email', '@', 1) AS name,
SUBSTRING_INDEX('email', '@', -1) AS domain
,对于mssql
SELECT
SPLIT_STRING('email', '@', 1) AS name,
SUBSTRING_INDEX('email', '@', -1) AS domain
这将输出为
name domain
sundar gmail.com
larry gmail.com