如何在Kohana Db Builder中创建以下查询
SELECT @i:=0;
UPDATE `table_name`
SET `order` = @i:=@i+1
where `column_name`= '3337'
答案 0 :(得分:0)
尝试分开查询!
$q1 = DB::query(NULL, "SELECT @i:=0");
$q2 = DB::update('table_name')
->set(array('order','=',DB::expr('@i:=@i+1')))
->where('column_name','=','3337');
$q1->execute();
$q2->execute();