我怎样才能做到这一点
select * from theuser where userid=1233 and active != 1
用正确的MysqL语法?
active可以是NULL,0或1,我需要的是活动等于NULL或0,永远不等于1.
最佳答案
select * from theuser where userid=1233 and (active is null or active != 1)
我怎样才能做到这一点
select * from theuser where userid=1233 and active != 1
用正确的MysqL语法?
active可以是NULL,0或1,我需要的是活动等于NULL或0,永远不等于1.
select * from theuser where userid=1233 and (active is null or active != 1)