'For ValueQuerySet (and subclasses like ValuesListQuerySet), they can
only be used as nested queries if they\'re already set up to select only
a single field (in which case, that is the field column that is
returned). This differs from QuerySet.as_sql(), where the column to
select is set up by Django.'

def _as_sql(self, connection):

    if ((self._fields and (len(self._fields) > 1)) or ((not self._fields) and (len(self.model._meta.fields) > 1))):
        raise TypeError(('Cannot    use    a    multi-field    %s    as    a    filter    value.' % self.__class__.__name__))
    obj = self._clone()
    if ((obj._db is None) or (connection == connections[obj._db])):
        return obj.query.get_compiler(connection=connection).as_nested_sql()
    raise ValueError("Can't    do    subqueries    with    queries    on    different    DBs.")
