(沒有版本資訊,可能只在 Git 中)
TableUpdate::orderby — 設定排序條件
$orderby_expr
, 混合 ...$orderby_exprs
): mysql_xdevapi\TableUpdate設定排序條件。
orderby_expr
定義排序條件的表達式。可以是一個包含一個或多個表達式的陣列,或是一個字串。
orderby_exprs
額外的 sort_expr 參數。
TableUpdate 物件。
範例 #1 mysql_xdevapi\TableUpdate::orderby() 範例
<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");
$schema = $session->getSchema("addressbook");
$table = $schema->getTable("names");
$res = $table->update()
->set('level', 3)
->where('age > 15 and age < 22')
->limit(4)
->orderby(['age asc','name desc'])
->execute();
?>