How can the following SQL be written via CodeIgniter active record methods?
SELECT p.*
FROM people p
WHERE p.age = (select max(subp.age) from people subp);
This will work
$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);