MySql text文本字段判断非空

    xiaoxiao2023-11-12  145

    text字段不能用 IS NOT NULL判断非空,要用!=''来判断非空

    //这里的comment是text属性字段,返回评论过的订单数量 select count(comment) as comment from orders where comment != ''; //返回没有评论过的订单数量 select count(comment) as comment from orders where comment = '';

    但是其他字段需要用 IS NOT NULL判断非空,IS NULL判断为空

    最新回复(0)