Reputation: 9251
In short, I'm trying to do the following using the gorm package.
UPDATE TableName t SET t.col1 = t.col2;
Is there a way to do where gorm only does 1 query?
Upvotes: 1
Views: 1146
Reputation: 2720
You can do this using Gorm methods
db.Table("TableName t").Update("t.col1", gorm.Expr("t.col2"))
Source: https://github.com/jinzhu/gorm/issues/1947#issuecomment-397376537
Upvotes: 2