How to use NULL or empty string in SQL

前端 未结 16 1661
悲&欢浪女
悲&欢浪女 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:41

    Select *
    From Table
    Where (col is null or col = '')
    

    Or

    Select *
    From Table
    Where IsNull(col, '') = ''
    

提交回复
热议问题