mysql中查询字段为null或者不为null
在mysql中,查询某字段为空时,不可用等号 = null,
而是 is null,不为空则是 is not null
select * from category where parentid is null; //取出顶级栏目,作为标题
select * from category where parentid is not null;
转载于:https://www.cnblogs.com/bj-tony/p/5360136.html