You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would this be possible to implement? It would mean a single query instead of looping over and updating.
It could look something like:
Model::updateMultiple([
[
// the primary key name of the model'id' => 1,
// the rest is what should be updated how'key' => 'value-for-id-1',
'key2' => 'value2-for-id-1',
],
[
// the primary key name of the model'id' => 2,
// the rest is what should be updated how'key' => 'value-for-id-2',
'key2' => 'value2-for-id-2',
]
]);
There is a sql CASE statement with WHEN and THEN keywords: tutorial
If possible, what are the limitations? Is there a statement max length?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Would this be possible to implement? It would mean a single query instead of looping over and updating.
It could look something like:
There is a sql
CASE
statement withWHEN
andTHEN
keywords: tutorialIf possible, what are the limitations? Is there a statement max length?
Beta Was this translation helpful? Give feedback.
All reactions