title: Why sql case is not working on null condition of int column
body: <p>I have used SQL CASE statement on an INT type of column of a table.
  Following is the SQL table schema and query which is working fine.</p>
  
  <p><strong>SQL Query</strong></p>
  
  <pre><code>CREATE TABLE #TEMP_A(ID BIGINT ,ACCEPTED INT)
  INSERT INTO #TEMP_A VALUES(1,1)
  INSERT INTO #TEMP_A(ID) VALUES(2)
  INSERT INTO #TEMP_A(ID) VALUES(3)
  INSERT INTO #TEMP_A(ID) VALUES(4)
  INSERT INTO #TEMP_A VALUES(5,1)
  
  SELECT T.ID,T.ACCEPTED,
  (CASE WHEN(T.ACCEPTED=1) THEN 'ACCEPTED' ELSE 'NOT ACCEPTED' END) AS STATUS
  FROM #TEMP_A T
  </code></pre>
  
  <p><strong>Query OUTPUT</strong></p>
  
  <pre><code>ID  ACCEPTED    STATUS
  1   1           ACCEPTED
  2   NULL        NOT ACCEPTED
  3   NULL        NOT ACCEPTED
  4   NULL        NOT ACCEPTED
  5   1           ACCEPTED
  </code></pre>
  
  <p>But now problem is here that I have a condition that I need to print not accepted in select statement so I tried following query</p>
  
  <p><strong>SQL Query</strong></p>
  
  <pre><code>SELECT T.ID,T.ACCEPTED,
  (CASE WHEN(T.ACCEPTED=NULL) THEN 'NOT ACCEPTED' END) AS STATUS
  FROM #TEMP_A T
  </code></pre>
  
  <p><strong>Query Actual OUTPUT</strong></p>
  
  <pre><code>ID  ACCEPTED    STATUS
  1   1           NULL
  2   NULL        NULL
  3   NULL        NULL
  4   NULL        NULL
  5   1           NULL
  </code></pre>
  
  <p><strong>Query Required OUTPUT</strong></p>
  
  <pre><code>ID  ACCEPTED    STATUS
  1   1           NULL
  2   NULL        NOT ACCEPTED
  3   NULL        NOT ACCEPTED
  4   NULL        NOT ACCEPTED
  5   1           NULL
  </code></pre>
  
  <p>I have to print status of those which are not accepted in select statement
  what should I do to get required result.</p>