ZF2 subquery

public function subquery()
{
    $sql = new \Zend\Db\Sql\Sql($this->adapter);
    $select = $sql->select()->from('comment');
    $selectSub = $sql->select()
            ->from('comment_vote')
            ->columns(['negativeVote' => new \Zend\Db\Sql\Expression('COUNT(comment_vote.id)')])
            ->where('comment_vote.commentId = comment.id');
    $select->columns(
            [
                'commentId' => 'id', 'comment',
                'nagetiveVoteCount' => new \Zend\Db\Sql\Expression('?', [$selectSub])
            ]
    );

    $statement = $sql->prepareStatementForSqlObject($select);
    $comments = $statement->execute();
    $resultSet = new \Zend\Db\ResultSet\ResultSet();
    $resultSet->initialize($comments);

    return $resultSet->toArray();
}

Find on stackoverflow.