Sql选择多列没有相同值的行

时间:2021-05-31 12:21:46
     a b
row1 0 0
row2 1 0
row3 1 1

how to select data where a&b ≠ 0 on a row? I want the result is row2 and row3

如何选择a&b≠0的数据?我想结果是row2和row3

2 个解决方案

#1


2  

Select
*
from
yourtable
where a <> 0
or b <> 0

#2


0  

SELECT * FROM `tableName` WHERE (a <> 0) OR (b <> 0);

#1


2  

Select
*
from
yourtable
where a <> 0
or b <> 0

#2


0  

SELECT * FROM `tableName` WHERE (a <> 0) OR (b <> 0);