How to write case when in where statement in Oracle I wrote below statement. In MySQL it executes ok, but in Oracle it fails with error:


  meg:ORA-00905: missing keyword


How should I write this SQL? 

SELECT count(*)   
FROM  userTable 
WHERE ( CASE WHEN mac IS NULL THEN mac IS NULL ELSE mac = '000fe95erd32' END )
You're mixing up two ways of doing case. You either need:

CASE &lt;expression&gt;
WHEN &lt;comparison expression&gt; THEN &lt;return expression&gt;
…


or

CASE
WHEN &lt;condition&gt; THEN &lt;return expression&gt;
...


your query is malformed

SELECT count(*)   
FROM  userTable 
WHERE ( CASE WHEN mac IS NULL THEN mac IS NULL ELSE mac = '000fe95erd32' END )


your clause is not well good. you can do it differently
 like this : 

SELECT count(*)   
FROM  userTable 
WHERE mac is null or mac = '000fe95erd32';


You can read here for further information.