On 08/15/2011 10:20 AM, Eduardo wrote:
Here is the example:


column_names = session.query(tab.c.name).filter(tab.c.value==354)
column_names = [column_name for (column_name,) in column_names]
query=sess.query(func.max(tab.columns['name']),datab.columns['article_id']).group_by(*column_names).all()

I'm not sure what you are trying to do here. I can see two problems:

   * You are asking here to group the results by the value of the
     'name' column, where I suspect you want to group based on the name
     column itself.
   * You are grouping based on something you are not selecting, which
     is not allowed


Wichert.

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