Commits

Mike Bayer  committed e9f84aa

fix typos, SQL server also needs union all

  • Participants
  • Parent commits 285b463

Comments (0)

Files changed (2)

File lib/sqlalchemy/orm/query.py

 
             class Part(Base):
                 __tablename__ = 'part'
-                part = Column(String)
-                sub_part = Column(String)
+                part = Column(String, primary_key=True)
+                sub_part = Column(String, primary_key=True)
                 quantity = Column(Integer)
 
             included_parts = session.query(
 
             incl_alias = aliased(included_parts, name="pr")
             parts_alias = aliased(Part, name="p")
-            included_parts = included_parts.union(
+            included_parts = included_parts.union_all(
                 session.query(
                     parts_alias.part, 
                     parts_alias.sub_part, 
             q = session.query(
                     included_parts.c.sub_part,
                     func.sum(included_parts.c.quantity).label('total_quantity')
-                ).\
+                ).\\
                 group_by(included_parts.c.sub_part)
 
         See also:

File lib/sqlalchemy/sql/expression.py

          compile time.
         :param recursive: if ``True``, will render ``WITH RECURSIVE``.
          A recursive common table expression is intended to be used in 
-         conjunction with UNION or UNION ALL in order to derive rows
+         conjunction with UNION ALL in order to derive rows
          from those already selected.
 
         The following examples illustrate two examples from 
 
             incl_alias = included_parts.alias()
             parts_alias = parts.alias()
-            included_parts = included_parts.union(
+            included_parts = included_parts.union_all(
                 select([
                     parts_alias.c.part, 
                     parts_alias.c.sub_part,