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好些
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好些
本文介绍了如何在SQL中查询字段是否为空或非空的具体方法,包括针对不同数据类型如字符型和整型的处理方式。
1538

被折叠的 条评论
为什么被折叠?



