isnull vs is null

后端 未结 10 1346
闹比i
闹比i 2020-12-06 00:13

I have noticed a number of queries at work and on SO are using limitations in the form:

isnull(name,\'\') <> \'\'

Is there a particul

10条回答
  •  既然无缘
    2020-12-06 00:25

    isnull(name,'') <> name
    

    Well I can see them using this because this way if the name doesn't match or is null it returns as a failed comparison. This really means: name is null or name <> name

    Where as this one name is not null just checks to see if the name is null.

提交回复
热议问题