MySQL is different than

How can i do this

select * from theuser where userid=1233 and active != 1

in the correct MySQL syntax?

activemaybe NULL, 0or 1, and I need active, an equal NULLor 0, never equal 1.

+5
source share
2 answers
select * from theuser where userid=1233 and (active is null or active != 1)
+9
source
SELECT *
  FROM theuser
 WHERE userid = 1233
   AND (active IS NULL OR active != 1)
+3
source

All Articles