The following statement is used:
id []int64
type Score struct {
Score int `gorm:"score"`
}
func GetScoreByID(score *Score, id []int64) error {
db.Table("question_bank").Select("sum(score) as score").Where("id IN ?", id).Scan(&score).Error
}
Report the following error:
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?,?,?)' at line 1
How can I write to achieve this functionality?