isnull vs is null

后端 未结 10 1344
闹比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:36

    isnull(name,'') <> :name is shorthand for (name is null or name <> :name) (assuming that :name never contains the empty string, thus why shorthands like this can be bad).

    Performance-wise, it depends. or statements in where clauses can give extremely bad performance. However, functions on columns impair index usage. As usual: profile.

提交回复
热议问题