美文网首页
为空和非空的查询

为空和非空的查询

作者: zjkdifvpwlkqumn | 来源:发表于2020-07-29 15:07 被阅读0次

1、不为空

Select * From table Where id<>''

Select * From table Where id!=''

2、为空

Select * From table Where id=''

Select * From table Where ISNULL(id)

具体情况具体分析,如果字段是char和varchar型用 id=''可以;如果是int型用 ISNULL好些

相关文章

网友评论

      本文标题:为空和非空的查询

      本文链接:https://www.haomeiwen.com/subject/erghrktx.html