1、不为空
Select * From table Where id<>''
Select * From table Where id!=''
2、为空
Select * From table Where id=''
Select * From table Where IS NULL(id)
具体情况具体分析,如果字段是char和varchar型用 id=''可以;如果是int型用 IS NULL好些
在mysql中,查询某字段为空时,切记不可用 = null,而是 is null,不为空则是 is not null www.2cto.com select * from table where column is null; select * from table where column is not null;