oracle:查询表A 一列B 不为0的所有值 B列有null,0,1 共3类值。

oracle:查询表A 一列B 不为‘0’的所有值 B列有null,0,1 共3类值。包括null值也需要查出来。
select * from A where 后面带有 3个 and条件。我试过 select * from A where B<>'0' or B is null 查出的和 and条件不符合。。

自己搞出来了。。。select * from A where ...and( B<>'0' or B is null ) and...and...加个括号 不过还是感谢答题的tX

select * from A where B='1' or B is null

select from A where B<>'0' or B is null

按照你补充的说明 你可以写成select * from A where 条件1 and 条件2 and 条件3 and (B<>'0' or B is null)
温馨提示:答案为网友推荐,仅供参考
相似回答