How do the SQL “IS” and “=” operators differ?
问题 I am building some prepared statements that use parametrized values. As an example: SELECT * FROM "Foo" WHERE "Bar"=@param Sometimes @param might be NULL . In such cases, I want the query to return records where Bar is NULL , but the above query will not do that. I have learned that I can use the IS operator for this. In other words: SELECT * FROM "Foo" WHERE "Bar" IS @param Aside from the differing treatment of NULL , are there any other ways in which the above two statements will behave