I asked a similar question a few days ago; it's still on the front page of
the group. Mike replied to that and gave some details
Your query would be something like:
----------------------------
class A(Base):
__tablename__ = 'a'
id = Column(Integer, primary_key=True)
cod_sticker = Column(String)
sticker_checklist = Column(String)
protocollo = Column(String)
q1 = sess.query(A.cod_sticker.label('bruciato'))
q2 = sess.query(A.cod_sticker.label('bruciato'))
q3 = sess.query(A.sticker_checklist.label('bruciato'))
q4 = sess.query(A.protocollo.label('bruciato'))
as_union = union(q1, q2, q3, q4)
as_union_alias = as_union.alias('foo')
q = sess.query(as_union_alias).filter( as_union_alias.c.bruciato ==
'E1212').count()
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.