summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/query.py2
-rw-r--r--django/db/models/sql/subqueries.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 4cc1500c94..e16d540b66 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -420,7 +420,7 @@ class Query(object):
if not self.alias_refcount[alias]:
continue
name, alias, join_type, lhs, lhs_col, col, nullable = self.alias_map[alias]
- alias_str = (alias != name and ' AS %s' % alias or '')
+ alias_str = (alias != name and ' %s' % alias or '')
if join_type and not first:
result.append('%s %s%s ON (%s.%s = %s.%s)'
% (join_type, qn(name), alias_str, qn(lhs),
diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py
index 0c32abd6a5..2c5a93e417 100644
--- a/django/db/models/sql/subqueries.py
+++ b/django/db/models/sql/subqueries.py
@@ -361,7 +361,7 @@ class CountQuery(Query):
"""
def get_from_clause(self):
result, params = self._query.as_sql()
- return ['(%s) AS A1' % result], params
+ return ['(%s) A1' % result], params
def get_ordering(self):
return ()