Skip to content

ORDER BY clause

Marijn van Wezel edited this page Oct 13, 2021 · 2 revisions

The ORDER BY clause accepts a list of properties to order on, and optionally whether to sort in descending order.

Examples

$n = Query::variable("n");

$name = $n->property("name");
$age = $n->property("age");

$statement = Query::new()
	->orderBy([$name, $age], true)
	->build();

$this->assertSame("ORDER BY n.name, n.age DESCENDING", $statement);
Clone this wiki locally