Sql 将单个列值拆分为多个列值时出现问题
周五,我发布了一个关于将单列值拆分为多列值的问题,我在那里遇到了一些问题,现在在我的源表中,我添加了一些新的feild,故事看起来像这样:Sql 将单个列值拆分为多个列值时出现问题,sql,sql-server,tsql,Sql,Sql Server,Tsql,周五,我发布了一个关于将单列值拆分为多列值的问题,我在那里遇到了一些问题,现在在我的源表中,我添加了一些新的feild,故事看起来像这样: first_name last_name ----------- ------------------ abcd efgh ijk lmn opq asdjja
first_name last_name
----------- ------------------
abcd efgh
ijk lmn
opq asdjja
asb asd
asd null
john tronton III
john bradly
null null (because user is not the name)
例如:
Name
---------------------
abcd efgh
ijk lmn
opq asd j. asdjja
asb (asdfas) asd
asd
john tronton III
john bradly 0
user
并期望输出如下所示:
first_name last_name
----------- ------------------
abcd efgh
ijk lmn
opq asdjja
asb asd
asd null
john tronton III
john bradly
null null (because user is not the name)
需要Select语句中的查询
中间名可以省略,不需要中间名。列已经创建,需要插入单个“名称”列中的数据
非常感谢
Shahsra你或许应该看看这个问题的答案 并查看下面的链接以供参考
你已经有足够的代表知道如何格式化你的问题-可读性越强,回答的可能性就越大…你能告诉我你在哪里不明白,这样我就可以向你解释我的问题吗?