有一个字符串如下:
"select f1 Code, f2 Value from tb1 where f3 = 'Code'"
或
"select f1 CODE, f2 Value from tb1 where f3 = 'Code'"
或
"select f1 Code, f2 VALUE from tb1 where f3 = 'Code'"
或
"select f1 CODE , f2 VALUE from tb1 where f3 = 'Code'"
或
"select f1 Code, f2 Value from tb1 where f3 = 'Code' order by VALUE "
凡此种种,想统一替换成"select f1 编码 , f2 名称 from tb1 where f3 = 'Code'"
或
"select f1 编码, f2 名称 from tb1 where f3 = 'Code' order by 名称 "
"select f1 Code, f2 Value from tb1 where f3 = 'Code'"
或
"select f1 CODE, f2 Value from tb1 where f3 = 'Code'"
或
"select f1 Code, f2 VALUE from tb1 where f3 = 'Code'"
或
"select f1 CODE , f2 VALUE from tb1 where f3 = 'Code'"
或
"select f1 Code, f2 Value from tb1 where f3 = 'Code' order by VALUE "
凡此种种,想统一替换成"select f1 编码 , f2 名称 from tb1 where f3 = 'Code'"
或
"select f1 编码, f2 名称 from tb1 where f3 = 'Code' order by 名称 "
replace(upper(S),'被替换值','目标值')如果你有多个替换,估计要嵌套了.
这几个SQL在我看来都是一样的啊
但是看楼主的意思最后好像还是想要小写
最好是
replace(lower(S),'code','编码')
"select f1 编码 , f2 名称 from tb1 where f3 = '编码'"
或
"select f1 编码, f2 名称 from tb1 where f3 = '编码' order by 名称 "
而我要的是
"select f1 编码 , f2 名称 from tb1 where f3 = 'Code'"
或
"select f1 编码, f2 名称 from tb1 where f3 = 'Code' order by 名称 "
单引号内的Code或code或codexxxx是不替换de
' code' 前面加上个空格' '
加空格不行,可以试试加code后面加','
不管怎么说,这是字串本身的问题,你总要找到替换和不替换的字串之间的区别才能做,
找到了,转换成代码就行了,找不到,怎么也没用.