On May 21, 2008, at 5:06 PM, EricHolmberg wrote:

>
> I'm doing a query and would like to order the results in alphabetical
> order.  However, the column used is mixed case, so the results have
> all lower-case strings before the upper-case variables.
>
> In SQL, I would fix this by using the lower() function such as:
>
> TABLE data (
> strName TEXT() NOT NULL
> );
>
> SELECT * FROM data ORDER BY LOWER(strName) ASC;
>
> How can I do this with SQLAlchemy?
>
> # How do I apply the lower(field) function to the strName column?
> rows = model.data.query().order_by(strName).all(


query.order_by(func.lower(strName))



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