Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for Sum (0.11 sec)

  1. go.sum

    qqxhb <******@****.***> 1692452011 +0800
    Plain Text
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 336 bytes
    - Viewed (0)
  2. chainable_api.go

    	tx.Statement.Joins = append(tx.Statement.Joins, join{Name: query, Conds: args, JoinType: joinType})
    	return
    }
    
    // Group specify the group method on the find
    //
    //	// Select the sum age of users with given names
    //	db.Model(&User{}).Select("name, sum(age) as total").Group("name").Find(&results)
    func (db *DB) Group(name string) (tx *DB) {
    	tx = db.getInstance()
    
    	fields := strings.FieldsFunc(name, utils.IsValidDBNameChar)
    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)
  3. schema/naming.go

    	if ns.IdentifierMaxLength == 0 {
    		ns.IdentifierMaxLength = 64
    	}
    
    	if utf8.RuneCountInString(formattedName) > ns.IdentifierMaxLength {
    		h := sha1.New()
    		h.Write([]byte(formattedName))
    		bs := h.Sum(nil)
    
    		formattedName = formattedName[0:ns.IdentifierMaxLength-8] + hex.EncodeToString(bs)[:8]
    	}
    	return formattedName
    }
    
    var (
    	// https://github.com/golang/lint/blob/master/lint.go#L770
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  4. clause/expression_test.go

    	}, {
    		Expressions: []clause.Expression{
    			clause.Eq{Column: clause.Expr{SQL: "SUM(?)", Vars: []interface{}{clause.Column{Name: "id"}}}, Value: 100},
    		},
    		ExpectedVars: []interface{}{100},
    		Result:       "SUM(`id`) = ?",
    	}, {
    		Expressions: []clause.Expression{
    			clause.Gte{Column: clause.Expr{SQL: "SUM(?)", Vars: []interface{}{clause.Column{Table: "users", Name: "id"}}}, Value: 100},
    		},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Aug 10 05:34:33 GMT 2023
    - 8.4K bytes
    - Viewed (0)
  5. tests/sql_builder_test.go

    		t.Error("Raw sql to update records")
    	}
    
    	DB.Exec("update users set age=? where name = ?", gorm.Expr("age * ? + ?", 2, 10), "jinzhu-raw")
    
    	var age int
    	DB.Raw("select sum(age) from users where name = ?", "jinzhu-raw").Scan(&age)
    
    	if age != ((1+10+20)*2 + 30) {
    		t.Errorf("Invalid age, got %v", age)
    	}
    }
    
    func TestRowsWithGroup(t *testing.T) {
    	users := []User{
    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)
Back to top