2019-08-02 14:54:34 星期五

1、不为空

1
2
3
Select   *   From   table_name Where id<>''

Select * From table_name Where id!=''

2、为空

1
2
3
Select   *   From   table_name Where id=''

Select * From table_name Where ISNULL(id)

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

参考文档

https://www.cnblogs.com/Liang-Haishan216/p/8308733.html