yii2判断数据库字段不为空

2020-11-06教程大全77200

/2020/11/76d29c44

yii2判断数据库字段is null,如下:

相关教程推荐:yii框架

示例:

$query = new Query;              
$query->select('ID, City,State,StudentName') 
      ->from('student')                                
      ->where(['IsActive' => 1]) 
      ->andWhere(['not', ['City' => null]]) 
      ->andWhere(['not', ['State' => null]]) 
      ->orderBy(['rand()' => SORT_DESC])       
      ->limit(10);

更多编程相关内容,请关注北冥有鱼编程技术建站教程编程入门栏目!

以上就是yii2判断数据库字段不为空的详细内容,更多请关注北冥有鱼编程技术建站教程其它相关文章!

本文地址:https://www.ufcn.cn/it/362010.html

如非特殊说明,本站内容均来自于网友自主分享,概不代表本站观点,如有任何问题我们都将在收到反馈后的第一时间进行处理!