我有疑问:
select text_b, id from articles where title is not null;
但是我希望显示text_b不为null且text_b的长度为>的结果。 0。 怎么做?
答案 0 :(得分:3)
select text_b, id
from articles
where title is not null
and length(text_b) > 0;
或
select text_b, id
from articles
where title is not null
and text_b <> '';
或正确处理null
text_b
值
select text_b, id
from articles
where title is not null
and text_b is distinct from '';