通过 gorm 访问数据库,通过Where
过滤可以正常使用Count
方法;但是Raw
过滤之后Count
方法总是0
db.Table("user").Where("name LIKE ?", "%jin%").Count(&count) //该count统计正确
db.Raw("select * from user").Count(&count) //该count总是0,并且报错
sql: expected 20 destination arguments in Scan, not 1