isnull vs is null

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

    It is to handle both the empty string and NULL. While it is good to be able to do with with one statement, isnull is proprietary syntax. I would write this using portable Standard SQL as

    NULLIF(name, '') IS NOT NULL
    

提交回复
热议问题