function Select::orderRandom
Overrides Select::orderRandom
File
-
core/
lib/ Drupal/ Core/ Database/ Driver/ pgsql/ Select.php, line 17
Class
- Select
- PostgreSQL implementation of \Drupal\Core\Database\Query\Select.
Namespace
Drupal\Core\Database\Driver\pgsqlCode
public function orderRandom() {
$alias = $this->addExpression('RANDOM()', 'random_field');
$this->orderBy($alias);
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.