public function column($db = null)
    {
        if ($this->emulateExecution) {
            return new LazyPromise(function() { return resolve([]); });
        }

        if ($this->indexBy === null) {
            return $this->createCommand($db)->queryColumn();
        }

        if (is_string($this->indexBy) && is_array($this->select) && count($this->select) === 1) {
            if (strpos($this->indexBy, '.') === false && count($tables = $this->getTablesUsedInFrom()) > 0) {
                $this->select[] = key($tables) . '.' . $this->indexBy;
            } else {
                $this->select[] = $this->indexBy;
            }
        }
        return $this->createCommand($db)->queryAll()->thenLazy(
            function($results) {
                $rows = [];
                foreach ($results as $row) {
                    $value = reset($row);

                    if ($this->indexBy instanceof \Closure) {
                        $rows[call_user_func($this->indexBy, $row)] = $value;
                    } else {
                        $rows[$row[$this->indexBy]] = $value;
                    }
                }

                return $rows;
            }
        );
    }