does anyone know how to do a nested query such as "SELECT * FROM (SELECT * FROM table LIMIT 0,12) table ORDER BY rand ()", using Zend_Db_Table?
1 Answer
It is not supported in direct way. You can try some workarounds, but still the best way will be to get db adapter and query manually like:
$db = Zend_Db_Table::getDefaultAdapter();
$db->query('SELECT * FROM (SELECT * FROM table LIMIT 0,12) table ORDER BY rand ()');
If you want try workarounds like creating 2 queries and mixing them, passing subquery as ->from() part etc. have a look at this topic Zend_Db_Table subquery