protected function generateCountSQL()
        {
            $sql = ($this->query->isDistinct()) ? 'SELECT COUNT(DISTINCT ' : 'SELECT COUNT(';
            $sql .= Query::quoteIdentifier($this->query->getSelectionColumn($this->getTable()->getIdColumn()));
            $sql .= ') as num_col';

            return $sql;
        }