select * from student where name ='张三'
其中name字段是varchar2(30)。由于这条记录name的值“张三”后面有个回车,因此检索不出来。刚在网上搜到的以下方法:
select *
from student
where replace(replace(name,char(10),''),char(13),'') ='张三' select *
from student
where replace(replace(replace(name,' ',''),char(10),''),char(13),'') ='张三' 都跑不动,提示说missing expression, 在PL/SQL Developer跑的时候在char(10)前划了红波浪线。使用的数据库是Oracle10.
烦请高手出招...
其中name字段是varchar2(30)。由于这条记录name的值“张三”后面有个回车,因此检索不出来。刚在网上搜到的以下方法:
select *
from student
where replace(replace(name,char(10),''),char(13),'') ='张三' select *
from student
where replace(replace(replace(name,' ',''),char(10),''),char(13),'') ='张三' 都跑不动,提示说missing expression, 在PL/SQL Developer跑的时候在char(10)前划了红波浪线。使用的数据库是Oracle10.
烦请高手出招...
解决方案 »
- oracle存储过程怎么输不出答案
- oracle 01830 日期格式图片在转换整个字符串之前结束
- 数据挖掘 属性组合 的sql语句 急!!!!! 高分!!!
- 关于Oracle9i时间字段的问题。。总差8小时。。。
- 求sql语句,都来看看啊!在线等候
- 有在P4+WINXP PRO上安装Oracle816经验请进!
- 分区表 求和值
- C#插入oracle10g个别表很慢
- 怎么快速将100万数据量的sql文件导入的数据库里呢???
- oracle 12c 通过imp导入dmp文件的问题
- 菜人问题:PL/SQL中的存储过程的写法中小小问题???
- Oracle Sql Scratchpad中能执行存储过程吗?用execute
楼主把char替换成chr才可以。。select *
from student
where replace(replace(name,chr(10),''),chr(13),'') ='张三' select *
from student
where replace(replace(replace(name,' ',''),chr(10),''),chr(13),'') ='张三'
from student
where replace(replace(name,char(10)||'',''),char(13)||'','') ='张三' ;try