title: How do the SQL "IS" and "=" operators differ?
body: <p>I am building some prepared statements that use parametrized values. As an example:</p>
  
  <pre><code>SELECT * FROM "Foo" WHERE "Bar"=@param
  </code></pre>
  
  <p>Sometimes <code>@param</code> might be <code>NULL</code>. In such cases, I want the query to return records where <code>Bar</code> is <code>NULL</code>, but the above query will not do that. I have learned that I can use the <code>IS</code> operator for this. In other words:</p>
  
  <pre><code>SELECT * FROM "Foo" WHERE "Bar" IS @param
  </code></pre>
  
  <p>Aside from the differing treatment of <code>NULL</code>, are there any other ways in which the above two statements will behave differently? What if <code>@param</code> is not <code>NULL</code>, but is instead, let's say, <code>5</code>? Is using the <code>IS</code> operator in that case a safe (and sane) thing to do? Is there some other approach I should be taking?</p>