Yii implements the following batch insertion method. If it is batch update, is there the same implementation method in Yii2?
Yii::$app->db
->createCommand()
->batchInsert($table, $columns, $rows)
->execute();
Batch update is a method of using a SQL statement to implement batch updates instead of cyclic updates, e.g:
UPDATE order
SET field = CASE order_no
WHEN 1 THEN 'value'
WHEN 2 THEN 'value'
WHEN 3 THEN 'value'
END
WHERE order_no IN (1,2,3)
replace into