Select more.
@param  string|Builder $field
@param  string|null    $as
@return self
763041
public function selectMore($field, string $as = null): self
    {
        return $this->select($field, $as, false);
    }
1298979
public function selectMax(string $field, $as=FALSE): QueryBuilderInterface
	{
		// Create the select string
		$this->state->appendSelectString(' MAX'.$this->_select($field, $as));
		return $this;
	}
1333109
public function selectArray($fields = null, $where = null, $orderBy = null, $limit = null): array
    {
        return self::select2($fields, $where, $orderBy, $limit);
    }
823780
public function field($field, $alias = null) {
        if (is_string($field)) {
            $fields = explode(',', trim($field));
            foreach ($fields as $field) {
                $this->fields [] = Condition::cleanField($field . ($alias ? ' AS ' . $alias : ''));
            }
        } else if ($field instanceof Query) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        } else if ($field instanceof ImmutableValue) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        }

        return $this;
    }
699001
public function orderBy($field, $order = 'ASC')
    {
        if(is_string($field) && trim($field) != '') {
            $field = trim($field);
            $field = ltrim($field, 'ORDER BY ');
            $this->order = ' ORDER BY `'.$field.'`'.(($order == 'DESC') ? ' DESC' : ' ASC');
        }
        return $this;
    }
471661
public static function where($field)
    {
        $root = new Node(Node::TYPE_CROTCH, Node::OPERATOR_BLANK);
        $criteria = new Criteria($field, $root);
        $root->append(Node::OPERATOR_BLANK, $criteria);

        return $criteria;
    }
155771
public function select($fields)
    {
        foreach ($this->queries as $query) {
            $query->select($fields);
        }

        return $this;
    }
1159950
public function select($fields)
    {
        foreach ($fields as $key => $value) {
            if (is_int($key)) {
                $this->associationQueryFields($value);
            } elseif (is_array($value)) {
                $alias = $this->tableAlias();
                $this->queryBuilder->join($this->getFullFieldName($key, self::DEFAULT_TABLE_ALIAS), $alias);
                foreach ($value as $valueField) {
                    $this->queryFields[] = $this->getFullFieldName($valueField, $alias);
                }
            } else {
                $this->queryFields[] = $value;
            }
        }
        $this->queryBuilder->select(implode(',', $this->queryFields));

        return $this;
    }
789107
public function select($fields = '*')
    {
        $query = new Query\SelectQuery();

        if ($this->pdo) {
            $query->setPDO($this->pdo);
        }

        return $query->select($fields);
    }
1361823
public function aggregate(string $fn, string $field = '*', string $as = null): self
    {
        static $fns = ['count', 'sum', 'avg', 'min', 'max'];

        $fn = strtolower($fn);
        if (!in_array($fn, $fns)) {
            throw new BuilderException(sprintf('Invalid function %s given, %s are supported only!',
                $fn, join(',', $fns)));
        }

        $field = $field ?: '*';

        // if as not provided
        if ($as == null) {
            // aggregate('count', 'x') count_x
            // aggregate('count', 'u.x') count_ux
            $as = ($field && $field != '*') ? preg_replace('~[^\w]~', '', $fn .'_'. $field) : $fn;
        }

        return $this->push('select', sprintf('%s(%s) AS %s', $fn, $field, $this->agent->quoteField($as)));
    }
684374
public function select($fields)
    {
        if (!$fields) {
            return $this;
        }

        if (is_string($fields)) {
            $fields = (array)preg_split('#[\s,]+#', $fields, -1, PREG_SPLIT_NO_EMPTY);
        }

        if ($fields) {
            $this->_projection_alias = [];

            if (isset($fields[count($fields) - 1])) {
                $this->_projection = array_fill_keys($fields, 1);
            } else {
                $projection = [];
                foreach ($fields as $k => $v) {
                    if (is_int($k)) {
                        $projection[$v] = 1;
                    } else {
                        $this->_projection_alias[$k] = $v;
                        $projection[$v] = 1;
                    }
                }
                $this->_projection = $projection;
            }

            if (!isset($this->_projection['_id'])) {
                $this->_projection['_id'] = false;
            }
        }

        return $this;
    }
729870
public function expressionForField($field)
    {
        return isset($this->select[$field]) ? $this->select[$field] : null;
    }
340108
public function select($fields=null)
    {
        if (func_num_args() > 1) {
            $fields = func_get_args();
        }
        $this->getQuery()->type('select')->fields($fields);
        return $this;
    }
357808
public function from(string $table, string $alias = null, $field = null): Select
    {
        $this->from[] = [
          'table' => $table,
          'alias' => $alias
        ];

        if ($field !== null) {
            if (is_array($field)) {
                foreach ($field as $fld) {
                    $this->field(($alias ?? $table) . '.' . $fld);
                }
            } else {
                $this->field(($alias ?? $table) . '.' . $field);
            }
        }

        return $this;
    }
638360
public function count(string $column = '*', string $as = null)
    {
        $this->columns = [
            '' => [Query\Aggregation::count($column, $as)],
        ];

        return $this;
    }
1093392
public function select($fields, $bind = [])
    {
        if (!is_array($fields)) {
            $fields = [$fields];
        }

        $this->select = $fields;

        $this->bind($bind, 'select');

        return $this;
    }
631902
public function buildOrderBy(array $fields)
    {
        $this->parseSelectPath();
        foreach ($fields as $field) {
            if (!is_array($field)) {
                $field = [$field];
            }
            $property = array_shift($field);
            if (!in_array($property, $this->aliasMapping) && isset($this->aliasMapping[$property])) {
                $property = $this->aliasMapping[$property];
            }
            $direction = $field ? array_shift($field) : 'ASC';
            $function = $field ? array_shift($field) : null;
            if ($function) {
                $property = sprintf("%s(%s)", $function, $property);
            }
            $this->addOrderBy($property, $direction);
        }

        return $this;
    }