A query that doesn't rely on broken GROUP BY might look like

select([forum_topics,
           select([func.max(forum_posts.c.created)],
                  forum_posts.c.topic_id==forum_topics.c.id,
scalar=True).label('last_post')],
          order_by=[desc('last_post')])

On 12/28/06, Mart <[EMAIL PROTECTED]> wrote:

Thanks, it worked!

On Dec 28, 6:47 pm, "Michael Bayer" <[EMAIL PROTECTED]> wrote:
> actually the GROUP BY wont go through as a keyword argument to
> query.select() at the moment, so youd have to use the full select
> statement.  but also, i dont see why youd want that GROUP BY in the
> query, you dont have any aggregate functions in your column list and
> also GROUP BY requires all non-aggregates to be part of the group (at
> least in postgres).

In MySQL and SQLite the GROUP BY removes the duplicate entries. (For
every post in the topic there is a row of that topic in the result.)

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to