如何匹配不为空+不为空? [英] How to match not null + not empty?
本文介绍了如何匹配不为空+不为空?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须对凌乱的数据库进行一些查询。有些列用 null
或空字符串填充。我可以这样查询:
I have to do some queries on a messy database. Some columns are filled with either null
or empty string. I can do query like this:
select * from a where b is not null and b <> '';
但是这种情况有捷径吗? (匹配每个非空值):
But is there a shortcut for this case? (match every "not empty" values) Something like:
select * from a where b is filled;
推荐答案
只是:
where b <> ''
会按照 null<>的要求执行操作‘’
为空,将不返回该行
will do what you want as null <> ''
is null and the row will not be returned
这篇关于如何匹配不为空+不为空?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文