Thanks for the quick response!

The following does *not* work.  Am I making the call incorrectly?

  sel = union_all(*[q.self_group() for q in querylist])


On Fri, Dec 5, 2008 at 4:08 PM, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> try calling self_group() on each select object.
>
> On Dec 5, 2008, at 3:55 PM, Bo Shi wrote:
>
>>
>> Hi all,
>>
>> There appear to be some nuances to using order by statements with set
>> operations like unions in MySQL but the following is allowed*:
>>
>>  (SELECT a,b from DBA.tbl ORDER BY b LIMIT 5)
>>  UNION ALL
>>  (SELECT a,b from DBB.tbl ORDER BY b LIMIT 5)
>>  ORDER BY b
>>
>> When I attempt to generate such a statement with:
>>
>>  union_all(*list_of_select_objs),
>>
>> The SQL generated lacks parentheses around the SELECT statements (in
>> addition to dropping the order by clauses, but that appears to be
>> expected behavior).  Is there a way to put the parentheses in?
>>
>>
>> *just an example, the query i've written is meaningless/useless :-)
>>
>>
>> --
>> Bo Shi
>> 207-469-8264
>>
>> >
>
>
> >
>



-- 
Bo Shi
207-469-8264

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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