def as_subquery_condition(self, alias, columns, compiler):
    qn = compiler.quote_name_unless_alias
    qn2 = self.connection.ops.quote_name
    if (len(columns) == 1):
        (sql, params) = self.as_sql()
        return (('%s.%s IN (%s)' % (qn(alias), qn2(columns[0]), sql)), params)
    for (index, select_col) in enumerate(self.query.select):
        (lhs_sql, lhs_params) = self.compile(select_col)
        rhs = ('%s.%s' % (qn(alias), qn2(columns[index])))
        self.query.where.add(QueryWrapper(('%s = %s' % (lhs_sql, rhs)), lhs_params), 'AND')
    (sql, params) = self.as_sql()
    return (('EXISTS (%s)' % sql), params)
def as_subquery_condition(self, alias, columns, compiler):
    qn = compiler.quote_name_unless_alias
    qn2 = self.connection.ops.quote_name
    if (len(columns) == 1):
        (sql, params) = self.as_sql()
        return (('%s.%s IN (%s)' % (qn(alias), qn2(columns[0]), sql)), params)
    for (index, select_col) in enumerate(self.query.select):
        (lhs_sql, lhs_params) = self.compile(select_col)
        rhs = ('%s.%s' % (qn(alias), qn2(columns[index])))
        self.query.where.add(QueryWrapper(('%s = %s' % (lhs_sql, rhs)), lhs_params), 'AND')
    (sql, params) = self.as_sql()
    return (('EXISTS (%s)' % sql), params)