作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
谁能告诉我,这是否可以通过事件记录来实现?如何实现?
$this->db->select('*');
$this->db->from('table1');
$this->db->join('table2', 'table1.id = table2.fi_id', 'left');
$this->db->having('table1.second_id','table2.fi_second_id', false);
$query = $this->db->get();
问题在于,'table2.fi_second_id' 始终被视为字符串 - 而不是数据库字段。也用'where'试过这个 - 这是同样的问题。
谢谢
最佳答案
我认为您想要以下内容:
$this->db->having('table1.second_id = table2.fi_second_id',false);
如果您不需要转义的 SQL 查询,您可以应用也可以不应用 false
参数。
关于php - Codeigniter Active Record HAVING/WHERE db.field = db.field,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15360036/
我是一名优秀的程序员,十分优秀!