Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for moving (0.2 sec)

  1. chainable_api.go

    	})
    	return
    }
    
    // Having specify HAVING conditions for GROUP BY
    //
    //	// Select the sum age of users with name jinzhu
    //	db.Model(&User{}).Select("name, sum(age) as total").Group("name").Having("name = ?", "jinzhu").Find(&result)
    func (db *DB) Having(query interface{}, args ...interface{}) (tx *DB) {
    	tx = db.getInstance()
    	tx.Statement.AddClause(clause.GroupBy{
    		Having: tx.Statement.BuildCondition(query, args...),
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  2. tests/sql_builder_test.go

    	}
    }
    
    func TestRowsWithGroup(t *testing.T) {
    	users := []User{
    		{Name: "having_user_1", Age: 1},
    		{Name: "having_user_2", Age: 10},
    		{Name: "having_user_1", Age: 20},
    		{Name: "having_user_1", Age: 30},
    	}
    
    	DB.Create(&users)
    
    	rows, err := DB.Select("name, count(*) as total").Table("users").Group("name").Having("name IN ?", []string{users[0].Name, users[1].Name}).Rows()
    	if err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  3. tests/query_test.go

    	users := []User{
    		{Name: "subquery_having_1", Age: 10},
    		{Name: "subquery_having_2", Age: 20},
    		{Name: "subquery_having_3", Age: 30},
    		{Name: "subquery_having_4", Age: 40},
    	}
    	DB.Create(&users)
    
    	var results []User
    	DB.Select("AVG(age) as avgage").Where("name LIKE ?", "subquery_having%").Group("name").Having("AVG(age) > (?)", DB.
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  4. schema/field.go

    			if !strings.Contains(v, "create") {
    				field.Creatable = false
    			}
    
    			if !strings.Contains(v, "update") {
    				field.Updatable = false
    			}
    		}
    	}
    
    	// Normal anonymous field or having `EMBEDDED` tag
    	if _, ok := field.TagSettings["EMBEDDED"]; ok || (field.GORMDataType != Time && field.GORMDataType != Bytes && !isValuer &&
    		fieldStruct.Anonymous && (field.Creatable || field.Updatable || field.Readable)) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
Back to top