我有个简单的问题...
Set @SQl1 = '415,417,418,419,420,416';
Set @SQl2 = REPLACE(@SQl1,","," ',' ");
Select @SQl1, @SQl2;
结果是-
@SQl1 = '415,417,418,419,420,416'
@SQl2 = '415 '','' 417 '','' 418 '','' 419 '','' 420 '','' 416'
但我想要这样的结果
@SQL2 = '415','417','418','419','420','416'
尝试了许多函数,如replace、Substring、json_unquote、quote ......但没有成功......
有人能帮忙吗?
1条答案
按热度按时间hc2pp10m1#
产出
| @SQL1|@SQL2|
| - ------|- ------|
| 415,417,418,419,420,416美元|“四一五”、“四一七”、“四一八”、“四一九”、“四二零”、“四一六”|
不要用双引号字符
"
引用字符串--它们会被用于JSON路径/值。