表里面有几千条带扣的字符串需要将扣去掉。 可以实现。也可以这样:update update tablenameset a=ltrim(a,'扣')where instrb(a,'扣')=1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SQL> create table test(id integer,content varchar2(20));Table createdSQL> insert into test(id,content)values(1,'扣fdfdfd');1 row insertedSQL> insert into test(id,content)values(2,'dfdfdd');1 row insertedSQL> update test 2 set 3 content=ltrim(content,'扣') 4 where instrb(content,'扣')=1;1 row updatedSQL> select * from test; ID CONTENT--------------------------------------- -------------------- 1 fdfdfd 2 dfdfddSQL> SQL> select ltrim('mississippi','mis') from dual;LTRIM('MISSISSIPPI','MIS')--------------------------ppiSQL> select replace('mississippi','mis','') from dual;REPLACE('MISSISSIPPI','MIS',''------------------------------sissippi以于字符串ltrim()与replace()是有区别,ltrim(a,b)出现在a的b所有辽符都删除,replace(a,b,c)是以c代替b出现在a字符串,它是整串,不以字节为单位. update tablename set a=substr(a,3,length(a)-2) where a like '扣%' update tablename set a=substr(a,2,length(a)-1) where a like '扣%' oracle 表空间的疑问 大虾们``帮帮忙啊``` 如何使用SQL修改字段长度? 有没有这样的SQL语句 NVL2()如何使用啊? oracle装不上 这个存储过程为什么权限不足? 在Oracle中,如何减少或消除记录连接(请教高手) Oracle安装过程中sql developer选择JDK路径出问题修改问题 ORACLE.exe 卡硬盘 report builder 高手进入 关于report排版问题 (200分)在jsp中,调用怎样的oracle的sql语句实现快速分页?是top还是rownum?最好给个例子????????????
2 set
3 content=ltrim(content,'扣')
4 where instrb(content,'扣')=1;1 row updatedSQL> select * from test; ID CONTENT
--------------------------------------- --------------------
1 fdfdfd
2 dfdfddSQL>
--------------------------
ppiSQL> select replace('mississippi','mis','') from dual;REPLACE('MISSISSIPPI','MIS',''
------------------------------
sissippi以于字符串ltrim()与replace()是有区别,ltrim(a,b)出现在a的b所有辽符都删除,replace(a,b,c)是以c代替b出现在a字符串,它是整串,不以字节为单位.