you'd use a select() construct in conjunction with Session.execute().

the current tutorial is mostly the same for 0.4:

http://www.sqlalchemy.org/docs/core/tutorial.html#selecting


On Oct 11, 2011, at 10:45 AM, Jakob L. wrote:

> Sorry if this has already been posted but couldn't find any docs for 0.4 nor 
> any examples where columns aren't used in the query. 
> 
> As I understand, you can't use columns in queries in 0.4. 
> 
> So how should I write: 
> session.query(Media.id, func.max(Media.sort_order)).first()
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/sqlalchemy/-/Tlll3oOFkDgJ.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.

-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to