Replies: 1 comment
-
@jinzhu help for gorm batch update |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I can use this code to realize update for " update set amount = amount -1 where id = 1"
tx.Table(dao.TInvoiceExpense).Where("id = ?",1).Updates(map[string]interface{}{ "amount": gorm.Expr("amount - ?", 1)})
how to realize batch update for "update set amount = amount -1 where id = 1; update set amount = amount -2 where id = 2; "
call mysql once.
Beta Was this translation helpful? Give feedback.
All reactions