diff --git a/manual/docs/Working with objects - Component overview - Query - ORDER BY - sorting query results.php b/manual/docs/Working with objects - Component overview - Query - ORDER BY - sorting query results.php index 0256f2273..f772c4b76 100644 --- a/manual/docs/Working with objects - Component overview - Query - ORDER BY - sorting query results.php +++ b/manual/docs/Working with objects - Component overview - Query - ORDER BY - sorting query results.php @@ -19,4 +19,7 @@ $users = $q->from('User u')->leftJoin('u.Email e')->orderby('e.address'); $users = $q->from('User u')->leftJoin('u.Email e') ->addOrderby('u.name')->addOrderby('e.address'); + +// grab randomly 10 users +$users = $q->select('u.*, RAND() rand')->from('User u')->limit(10)->orderby('rand DESC');