1.20.x select.inc public SelectQuery::orderRandom()

Implements SelectQueryInterface::orderRandom().

return SelectQuery

Overrides SelectQueryInterface::orderRandom

File

includes/database/select.inc, line 1605

Class

SelectQuery
Query builder for SELECT statements.

Code

public function orderRandom() {
  $alias = $this->addExpression('RAND()', 'random_field');
  $this->orderBy($alias);
  return $this;
}