How do the SQL “IS” and “=” operators differ?

后端 未结 5 1961
粉色の甜心
粉色の甜心 2021-01-03 21:59

I am building some prepared statements that use parametrized values. As an example:

SELECT * FROM \"Foo\" WHERE \"Bar\"=@param

Sometimes

5条回答
  •  隐瞒了意图╮
    2021-01-03 22:30

    I don't know what version of SQL you are using but IS makes no sense in the context you just described. I get a syntax error if I try to use it the way you described. Why would you want to use it over = anyway? This is the common usage and the one software maintainers woudl expect to find.

提交回复
热议问题