From 11ade8eefd32f5bc7ee6379b77824f02ca61c20b Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 6 Oct 2017 18:47:41 +0200 Subject: [PATCH] Refs #24254 -- Removed unnecessary SQL AS clause in SQLCompiler.as_sql(). Incorrect on Oracle. --- django/db/models/sql/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 6d063c4a05..078a8477af 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -559,7 +559,7 @@ class SQLCompiler: subselect, subparams = select_clone.as_sql(self, self.connection) sub_selects.append(subselect) sub_params.extend(subparams) - return 'SELECT %s FROM (%s) AS subquery' % ( + return 'SELECT %s FROM (%s) subquery' % ( ', '.join(sub_selects), ' '.join(result), ), sub_params + params