On Feb 22, 2008, at 6:10 PM, naktinis wrote:

>
> Hello,
> I was wondering if it's possible to do several unions using
> SQLAlchemy. I had no problems writing a sqlalchemy query with one
> union, but after aplying the second one it returned 'CompoundSelect'
> object has no attribute 'union', which probably means the returned
> object with union applied cannot have another union applied on top of
> it. However, MySQL syntax supports several unions (it looks like
> "SELECT smth1 WHERE condition1 UNION SELECT smth2 WHERE condition2
> UNION SELECT smth3 WHERE condition3 ... ") So, is there a way to
> something similar using SQLAlchemy?
>

yeah i actually updated the docs on this one to favor using the  
standalone union() construct which allows better control over nesting  
and such (particularly in combination with other compound operators  
like intersect, except_ ):

union(select(), select(), select(), ....)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to