Robert Leftwich wrote:
> I'll have a go at it shortly, but have a related question - is it possible
> to
> label calculated columns? i.e. to end up with
>
>    SELECT date, (unit_price * qty) as total_price WHERE total_price >
> 1000;
>

   (table.c.unit_price * table.c.qty).label('total_price')

will give you the label that will work in the column clause.

although sticking the "label" object in the WHERE clause isnt going to
work as of yet, youd have to repeat the expression (dont some DB's require
it explicitly anyway? im pretty sure oracle does...)





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to