我在codeigniter中工作。我想知道,如何在codeigniter中编写以下代码。
SELECT p.* FROM people p WHERE p.age = (select max(subp.age) from people subp);
这会工作
$this->db->select('p.*');
$this->db->from('people p');
$this->db->where('p.age = (select max(subp.age) from people subp)',null,false);
$result = $this->db->get()->result_array();
print_r($result);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句