In batch query method we can retrieve data in batches. We can use batch using yii\db\Query::batch().
Yii2 batch update
$rows = $query->select(['name','email'])
->from('tblName1')
->all();
$columnNames = ['name','email'];
$result = \Yii::$app->db->createCommand()->batchInsert('tblName2', $columnNames, $rows)->execute();
ReplyDeleteThis post will be very useful to us....i like your blog and helpful to me...
Remote Yii Framework Development in India