How to use NULL or empty string in SQL

前端 未结 16 1457
悲&欢浪女
悲&欢浪女 2020-12-23 20:20

I would like to know how to use NULL and an empty string at the same time in a WHERE clause in SQL Server. I need to find records that have either null values o

16条回答
  •  醉梦人生
    2020-12-23 20:36

    You could use isnull function to get both null and empty values of a text field:

    SELECT * FROM myTable
    WHERE isnull(my_nullable_text_field,'') = ''
    

提交回复
热议问题