php - 使用 codeigniter 查询选择属性设置为 null 的字段
问题描述
我正在尝试创建以下语句:
$this->db->where('uu.usuario_grupo_id is null');
但它不起作用
我也试过这个:
$this->db->where('uu.usuario_grupo_id =', null);
$this->db->where('uu.usuario_grupo_id =', 'null');
这些选项都不会从引用为 null 的字段返回数据。
解决方案
你可以这样做:
$this->db->where(array('uu.usuario_grupo_id' => NULL));
生产
WHERE `usuario_grupo_id` IS NULL
推荐阅读
- javascript - url 为 bittorent 协议编码哈希
- git - 将一个 repo 中的分支合并到另一个 repos 分支
- apache-spark - 如何在使用 SparkSession 读取 CSV 提取时设置分区计数?
- rust - 将可迭代传递给函数并在 rust 中迭代两次
- java - 我如何与带有 senerity 剧本的下拉列表交互
- c# - 在 .NET 5 中仅记录中间件中的特定异常
- google-apps-script - 需要登录的 Google Apps 脚本公共开发链接
- email - 仅用于表格标题的圆角
- reactjs - react-table setState 不更新表内组件的显示
- excel - 我的 Excel 散点图不会读入我的所有数据?