[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread voltron
I´m guessing a bit because I still could not find the group_by entry in the docs This works: user.select(links.c.id 3, order_by=[user.c.id]).execute() but this does not user.select(links.c.id 3,group_by=[user.c.dept]).execute() What should be the right syntax? Thanks On Jun 27, 4:07 pm,

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread Andreas Jung
--On 27. Juni 2007 12:00:13 -0700 voltron [EMAIL PROTECTED] wrote: I´m guessing a bit because I still could not find the group_by entry in the docs This works: user.select(links.c.id 3, order_by=[user.c.id]).execute() but this does not user.select(links.c.id

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread voltron
Then it must be a bug, I still get an error _executebuild\bdist.win32\egg\sqlalchemy\engine\base.py 602 SQLError: (ProgrammingError) column user.id must appear in the GROUP BY clause or be used in an aggregate function On Jun 27, 9:09 pm, Andreas Jung [EMAIL PROTECTED] wrote: --On 27.

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread Huy Do
I think you should listen to that error message. user.id must appear in the group by or be used in an aggregate function i.e count, sum, avg etc. The other problem you are using the ORM interface. You should be using the SQL select. I'm not sure what you are trying to achieve, but your

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread voltron
Could you point me to the url where this example is? I wonder why order_by and other things work with the ORM then and group_by left out Thanks On Jun 28, 1:19 am, Huy Do [EMAIL PROTECTED] wrote: I think you should listen to that error message. user.id must appear in the group by or be used

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread Eric Ongerth
On Jun 27, 4:34 pm, voltron [EMAIL PROTECTED] wrote: Could you point me to the url where this example is? I wonder why order_by and other things work with the ORM then and group_by left out Here is where to find the group_by method in the documentation: From the main table of contents,

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread Michael Bayer
On Jun 27, 2007, at 7:34 PM, voltron wrote: Could you point me to the url where this example is? I wonder why order_by and other things work with the ORM then and group_by left out also you need to understand the behavior of group by, as far as SQL. postgres in particular, as well as