数据库
首页 > 数据库> > MYSQL 判断为空和空字符串

MYSQL 判断为空和空字符串

作者:互联网

MYSQL 中,进行空值的判断:

判断某个字段是否为空

isnull 判断是否为空:
只有当字段为null时,isnull()返回1,空串和有数据都为0
select * from user where ISNULL(name)=1;
is not null
select * from user where name is not null;

判断某个字段是否为空串

select goods_id,item_code from goods_info where LENGTH(trim(item_code))>0

标签:判断,code,空串,MYSQL,字符串,null,where,select,空和空
来源: https://blog.csdn.net/yuxuan89814/article/details/111625510