diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index 2aa2c0f405..afcf437e9d 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -1478,7 +1478,7 @@ class SelectBase(Executable, FromClause): included_parts.c.sub_part, func.sum(included_parts.c.quantity). label('total_quantity') - ]).\ + ]).\\ group_by(included_parts.c.sub_part) result = conn.execute(statement).fetchall()