Codeigniter join,group_by和max

I can't find a way to get it working. I have to tables, the first with orders and the second with trackings. I want to add the latest tracking row to left table row. This is what I've tried so far (doesn't work):

        $this->db->select('orders.*, trackings.id AS trackings_id, trackings.order_id AS trackings_order_id, MAX(trackings.status) AS trackings_status, trackings.created_at AS trackings_created_at, trackings.updated_at AS trackings_updated_at, trackings.ip_address AS trackings_ip_address');
        $this->db->from('orders');
        $this->db->join('trackings', 'orders.id = trackings.order_id', 'left');
        $this->db->group_by('trackings.order_id');
        $this->db->order_by('orders.created_at', 'DESC');
        $query = $this->db->get();
        return $query->result();

Woooh, I hate CI's active records, this is a real pain in the butt most of times...

First of all, I'd group by orders.id

Secondly, would be great if you'd define "not working" (gives wrong results? doesn't execute at all?)

P.S. Sorry for posting it as answer (I'd prefer comment) but my rep is still kinda low...