必须将逗号分隔的字符串拆分为第二列。 包括下表:
CL1 POS POS2 LENGHT ALLELE
13015108和3015109 a
23015110、301520010 b
3015200、301530015c
43015450、301550020 d
53015600、301570015e
我想把逗号后的数字分成第二列的POS2,所以应该这样做
CL1 POS POS2 LENGHT ALLELE
1 3015108 3015109 5 A
2 3015110 3015200 10 B
3 3015200 3015300 15 C
4 3015450 3015500 20 D
5 3015600 3015700 15 E
所以我调查了以下内容:
插入我的表(pos2)。
selectright(POS,CHARINDEX ),),pos )1) FROM MyTable;
It returns an error :
error1305(42000 ) : function test.charindexdoesnotexist