func havingSameMapper(engine *xorm.Engine, t *testing.T) { users := make([]Userinfo, 0) err := engine.GroupBy("`Username`").Having("`Username`='xlw'").Find(&users) if err != nil { t.Error(err) panic(err) } fmt.Println(users) }
func having(engine *xorm.Engine, t *testing.T) { users := make([]Userinfo, 0) err := engine.GroupBy("username").Having("username='******'").Find(&users) if err != nil { t.Error(err) panic(err) } fmt.Println(users) /*users = make([]Userinfo, 0) err = engine.Cols("id, username").GroupBy("username").Having("username='******'").Find(&users) if err != nil { t.Error(err) panic(err) } fmt.Println(users)*/ }