added RAND orderby
This commit is contained in:
parent
61dc5e19c2
commit
8b95e7e719
1 changed files with 3 additions and 0 deletions
|
@ -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');
|
||||
</code>
|
||||
|
|
Loading…
Add table
Reference in a new issue