Oracle 从一列中拆分数据并在另一列中更新
我想用另一列中的数据更新一列 记录:-Oracle 从一列中拆分数据并在另一列中更新,oracle,sql-update,Oracle,Sql Update,我想用另一列中的数据更新一列 记录:-Hello MP123 我想使用Oracle中的更新查询更新另一列中的MP123,您可以使用下面的查询更新记录 Update table_name set column_2 = substr(column1,start,end); 您可以使用INSTR(字符串、子字符串[、起始位置[、外观]) 以获得起始和结束位置 update temp_table_sub set column_2 = substr(column1,instr(column1,' '
Hello MP123
我想使用Oracle中的更新查询更新另一列中的
MP123
,您可以使用下面的查询更新记录
Update table_name
set column_2 = substr(column1,start,end);
您可以使用INSTR(字符串、子字符串[、起始位置[、外观])
以获得起始和结束位置
update temp_table_sub
set column_2 = substr(column1,instr(column1,' ') +1 );
您可以使用
replace
string函数
update tab
set col1 = replace(col1,'MP123',col2)
Oracle SQL
/PLSQL
中的replace
函数的语法:
replace(string1,string\u to\u replace[,replacement\u string])