take a look at the over() construct:

http://www.sqlalchemy.org/docs/core/expression_api.html?highlight=over#sqlalchemy.sql.expression.over


On Jun 10, 2011, at 10:35 AM, Jojo wrote:

> hi guys, I'm new in sqlalchemy and I need some help.
> 
> I want make a simple aggregation query for a game chart, so, I need
> max score for a player, player name and row number (for chart
> position)
> 
> 
> this is the query in t-sql (mssql):
> 
> select row_number() over (order by max(score) desc), max(score), id,
> player_name
> from mychart
> group by id, player_name
> 
> how can I do that in sqlalchemy?
> 
> thank you
> 
> -- 
> 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.
> 

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