title: Using Case Statement in SQL with parameter/variable to check for Null values
body: <p>I am trying to write a SQL Select statement to return records based on a user input through a front end. 
  I want to write the Select statement like this:</p>
  
  <pre><code>SELECT somefields
  FROM sometable
  WHERE CASE variable
           WHEN 'blank' THEN field IS NULL
           ELSE field = field
        END
  </code></pre>
  
  <p>Basically I either want to filter a column to find NULL values or ignore the filter and return all values depending on the value of the variable. I know that the results of the CASE statement is not executable but how can I do this?</p>