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 get an error here:
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]
This I want to do:
1) I want to find all names that satisfy this query
column_names = session.query(tab.c.name).filter(tab.c.value==354)
2) Among those rows I want to find those with the highest id ( all
rows with the same name are fist grouped and only the one with the
highest id is retained the
On Aug 15, 2011, at 6:03 AM, Eduardo wrote:
This I want to do:
1) I want to find all names that satisfy this query
column_names = session.query(tab.c.name).filter(tab.c.value==354)
2) Among those rows I want to find those with the highest id ( all
rows with the same name are fist grouped