code: func (session *Session) sum(res interface{}, bean interface{}, columnNames ...string) error {
  	if session.isAutoClose {
  		defer session.Close()
  	}
  
  	v := reflect.ValueOf(res)
  	if v.Kind() != reflect.Ptr {
  		return errors.New("need a pointer to a variable")
  	}
  
  	var isSlice = v.Elem().Kind() == reflect.Slice
  	var sqlStr string
  	var args []interface{}
  	var err error
  	if len(session.statement.RawSQL) == 0 {
  		sqlStr, args, err = session.statement.genSumSQL(bean, columnNames...)
  		if err != nil {
  			return err
  		}
  	} else {
  		sqlStr = session.statement.RawSQL
  		args = session.statement.RawParams
  	}
  
  	if isSlice {
  		err = session.queryRow(sqlStr, args...).ScanSlice(res)
  	} else {
  		err = session.queryRow(sqlStr, args...).Scan(res)
  	}
  	if err == sql.ErrNoRows || err == nil {
  		return nil
  	}
  	return err
  }
docs: // sum call sum some column. bean's non-empty fields are conditions.