本文介绍了为同一列分隔多个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好, 假设我有一个包含7列的表,一列有多个以逗号(,)分隔的值,如下所示: table1(' Samira',' grade1',' 数学,历史,英语,science',' ',' ',' ' )... 我想要做的是重复相同的记录多次,就像这一列中的值一样,换句话说table1应该是这样的: (' Samira',' grade1',' maths',' ',' ',' ')(' Samira',' grade1',' history',' ', ' ',' ')(' Samira',' grade1',' English',' ',' ',' ' )(' Samira',' grade1',' science ',' ',' ',' ') 有没有办法在SQL中执行此操作? i知道我可以使用 SUBSTRING ,但如何重复同样的记录? 提前致谢 Samira 解决方案 Hi all,let's say I have a table with 7 columns and one column has multiple values separated by comma (,) like this:table1 ('Samira','grade1','maths,history,English,science','','','' )...what i want to do is repeat the same record as many times as the values in this column, in other words table1 should look like this:('Samira','grade1','maths','','','' )('Samira','grade1','history','','','' )('Samira','grade1','English','','','' )('Samira','grade1','science','','','' )is there a way to do that in SQL?i know i could use SUBSTRING, but how to repeat the same record?Thanks in advanceSamira 解决方案 这篇关于为同一列分隔多个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
05-16 00:15