select count(*) from tab where name=' ';符合条件的记录数为53521
select count(*) from tab where regexp_like(name,'[[:space:]]');
符合条件的记录数为68838
select count(*) from tab where name is null;
符合条件的记录数为0
本帖最后由 DJQTDJ 于 2015-8-12 09:39 编辑 jane_pop 发表于 2015-8-12 09:23
如果使用select * from tab where regexp_like(name,'[[:space:]]');的话是否能将name字段里面所有显示为空 ...听我的用这种方法写,那个函数有些环境有问题,算了我多写点把
这个是查找全部空格的select * from tab where name like '% %'复制代码这个是查找中间的select * from tab where name like '_ %_'复制代码这个查最后的空格select * from Tttt where name like '_%_ '复制代码最前的你反过来写select * from Tttt where name like ' _%_'复制代码
〇〇 发表于 2015-8-12 13:26
_能表示0个字符吗
测试了,不能
SQL> select * from dual where ' ' like '_ _';
未选定行
SQL> c/_/%
1* select * from dual where ' ' like '% _'
SQL> c/_/%
1* select * from dual where ' ' like '% %'
SQL> /
D
-
X