0

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

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.