我必须对凌乱的数据库进行一些查询。有些列填充了null
或空字符串。我可以这样查询:
select * from a where b is not null and b <> '';
但这种情况有没有捷径? (匹配每个“非空”值)类似于:
select * from a where b is filled;
答案 0 :(得分:15)
只需:
where b <> ''
将执行您想要的操作,因为null <> ''
为null并且不会返回该行
答案 1 :(得分:1)
{settings}