问题:
给定一个包含逗号分隔列的表值,目标是将每个值转换为单独的值rows.
查询:
SELECT A.[id], Split.a.value('.', 'VARCHAR(100)') AS processedrows FROM (SELECT [id], CAST ('<M>' + REPLACE([string], ',', '</M><M>') + '</M>' AS XML) AS String FROM Sample) AS A CROSS APPLY String.nodes ('/M') AS Split(a);
解释:
参考:
以上是如何从 SQL 中以逗号分隔的列值中提取行?的详细内容。更多信息请关注PHP中文网其他相关文章!