sql php mysql
表名: table1 oracle的,mysql没有测试,把对应的函数换成mysql的应该就可以了。
select replace(firstStr, 's', 'a')||secondStr
from (SELECT substr(str, 0, instr(str, 's')) firstStr,
substr(str, instr(str, 's')+1) secondStr
FROM (select t1.value str from table1 t1 where t1.id=1))
不好意思刚刚那个忘记换个字符。
oracle的,mysql没有测试,把对应的函数换成mysql的应该就可以了。
select replace(firstStr, '4', '3')||secondStr
from (SELECT substr(str, 0, instr(str, '4')) firstStr,
substr(str, instr(str, '4')+1) secondStr
FROM (select t1.value str from table1 t1 where t1.id=1))
select replace(firstStr, '3', '4')||secondStr
from (SELECT substr(str, 0, instr(str, '3')) firstStr,
substr(str, instr(str, '3')+1) secondStr
FROM (select t1.value str from table1 t1 where t1.id=1))