title: Zend Framework - applying order by on a nested query
body: <p>This might be a very simple thing. Check out the normal sql query below</p>
  
  <pre>
  (select * from shopping order by shopping_id desc limit 5) order by RAND()
  </pre>
  
  <p>This query runs successfully in mysql - not sure if this is the right way of doing it - but it works. It gets the last 5 ids from shopping table and randomly orders them everytime</p>
  
  <p>I want to achieve this in Zend. I'm not sure how to execute the first part and then apply the RAND clause to the results - what I have below does not do that.</p>
  
  <pre>
  $select = $this->select()       
             ->from(array('sh'=>'shopping'))
             ->order('shopping_id desc')
             ->limit(5)    
             ->order('RAND()');
  </pre>