oracle不能过滤空串字段!

plsql+oralce11gR2不能过滤空串字段!
图片说明

不管字段是null还是空格都可行,要用函数来实现
where nvl(trim(phonenumber),'0')<>'0'

这个字段应该是有空格,加上 and t.phonenumber !=''试下

这样也可以!
select * from t_user t where t.phonenumber is not null and t.phonenumber <> ' ';
有更好的sql吗?

这样倒也可以!
select * from t_user t where t.phonenumber not like ' %';

is not null是排除列为null值的, !='' 这种方式是判断列里面没有值的
所以按找你这里的情况应该用!=''
当然,如果说你有些列里面有多个空格的话,那就要去空格咯

!= ''应该可以 ,或者is not null

你可以试一下<>"",排除。

试一下这个
select * from t_user t where t.phonenumber is not null and t.phonenumber <> ' ';

is null 或者 is not null , 最好先看下 是不是 有空格

去空格后再判断是否为空,空字符串属于非空属性