It is possible to generate the following query by CI Query Builder class ?
SELECT name
FROM table1 t1
JOIN
(SELECT ID FROM table2 ORDER BY id LIMIT 5) t2
ON t2.id=t1.t2_id
WHERE t1.id>5
Well there are a couple of ways of doing it. One way is here which is a hack.
How can I rewrite this SQL into CodeIgniter's Active Records?
This other way is very simple.
Some point about it.
You are bound to use from clause in subqueries because get runs the query.
In codeigniter 2 _compile_select and _reset_select can not be accessed because they are protected methods.
You may have to remove the keyword before both methods in system/database/DB_active_rec.php
This article is useful too.