1 select.inc public SelectQuery::orderRandom()

Implements SelectQueryInterface::orderRandom().

Return value

SelectQuery:

Overrides SelectQueryInterface::orderRandom

File

core/includes/database/select.inc, line 1603

Class

SelectQuery
Query builder for SELECT statements.

Code

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