现在有下面2个查询语句
select ltrim('helloworld','hello') from dual
这个函数是截取左边的hello然后剩下world这个没有问题但用rtrim函数截取
select rtrim('helloworld','dlrow') from dual
期望是hello结果只剩下he了
但是如果使用
select rtrim('helloworld','dlro') from dual
这样结果就是
hellow
为什么多了个W结果查这么多
select ltrim('helloworld','hello') from dual
这个函数是截取左边的hello然后剩下world这个没有问题但用rtrim函数截取
select rtrim('helloworld','dlrow') from dual
期望是hello结果只剩下he了
但是如果使用
select rtrim('helloworld','dlro') from dual
这样结果就是
hellow
为什么多了个W结果查这么多
解决方案 »
- oracle在insert时如何根据count进行插入控制
- oracle求一查询结果
- alter user 两次改变用户表空间后的状况
- 不同用户同一张表,查询结果竟然不一样
- Exp 命令导出某个表的某个分区的数据
- 存储字符 有没有比varchar2 更大的类型?
- 高分求语句1条 关于ORACLE的 FULL JOIN 初级问题
- 在红帽子9。0下安装Oracle8。1。6,一开始就提示Java类的错误,大家能解决吗?
- 登陆enterprise manager那个sysman的密码可以找的到吗?
- 急!!!!!!!!关于添加字段和数据问题!!!!!!!
- 导入库时报错About to enable constraints
- plsql developer 怎么样连接远程数据库?
removed up to the first character not in set; set defaults to ' ', a
single blank.
ltrim函数的第二个参数是一个字符集合,rtime会去掉集合中的任意字符,直到碰到一个不在集合中的字符;
所以,如下查询中由于e为从右边开始第一个不在dlrow中的字符,所以剩余结果he正确。
select rtrim('helloworld','dlrow') from dual
例如select rtrim('helloworld','dlrow') from dual
期望是hello结果只剩下he了
因为前几个字符均在截取的范围之内直到字符e不是为止
在如
select rtrim('helloworld','dlro') from dual
这样结果就是
hellow
因为w没有在截取范围之内所以就停止了。