MySQL不同于

use*_*027 5 mysql

我怎样才能做到这一点

select * from theuser where userid=1233 and active != 1
Run Code Online (Sandbox Code Playgroud)

用正确的MySQL语法?

active可以是NULL,0或者1我需要的是active等于NULL0永远不等于1.

Nic*_*ssu 10

select * from theuser where userid=1233 and (active is null or active != 1)
Run Code Online (Sandbox Code Playgroud)