On Jun 2, 2008, at 1:01 PM, Jeff Putsch wrote:

> print pwEntries.query().filter(
>  or_(*ors)
> ).order_by
> (func.lower(pwEntries.eid).desc()).order_by(pwEntries.uname).compile()
>

reading further, it seems like "DISTINCT ON" doesn't even work the way  
it does in MySQL - theres no comma between the DISTINCT_ON portion of  
things and the rest of the columns and it is not actually returning  
columns....so my notion of using select([distinct(...)]) is not  
appropraite here.   Additionally, you're trying to do this with ORM  
and Query only has a "distinct()" method which does the regular SQL  
form of "DISTINCT".

I think the only way this would be possible in ORM for the time being  
is query.from_statement(<statement>), where <statement> is a select()  
construct or a full text string.  the solution for select() /query()  
would be adding arguments to (select()/query()).distinct().




--~--~---------~--~----~------------~-------~--~----~
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