第一种写法:

select * from table where id != null;
select * from table where id <> null;
select * from table where not id = '';

容易查不出来
使用is not null

select * from table where id is not null

更多推荐

sql语句非空判断