'Perform the same functionality as the as_sql() method, returning an
SQL string and parameters. However, the alias prefixes are bumped
beforehand (in a copy -- the current query isn\'t changed), and any
ordering is removed if the query is unsliced.
Used when nesting this query inside another.'

def as_nested_sql(self):

    obj = self.query.clone()
    if ((obj.low_mark == 0) and (obj.high_mark is None)):
        obj.clear_ordering(True)
    obj.bump_prefix()
    return obj.get_compiler(connection=self.connection).as_sql()
