Re: how to do SQL SUM

2007-01-14 Thread Honza Král
On 1/14/07, Mark Striebeck <[EMAIL PROTECTED]> wrote: Hey, that's exactly what I needed too. But when I tried it, I got a OperationalError: (1140, 'Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause') my bad... sorry try qset.extra(

Re: how to do SQL SUM

2007-01-14 Thread Mark Striebeck
Hey, that's exactly what I needed too. But when I tried it, I got a OperationalError: (1140, 'Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause') I'm using MySQL - maybe I need a different syntax there. But I can easily use SUM direc

Re: how to do SQL SUM

2007-01-13 Thread Honza Král
On 1/13/07, Picio <[EMAIL PROTECTED]> wrote: Hello, in my custom view, when I retrieve a query set, I need to add (i mean do the sum) of all the values in a column. Is there a built in django-way to do it, instead to write python code myself? In the db_api I saw order_by but I cant see something

how to do SQL SUM

2007-01-13 Thread Picio
Hello, in my custom view, when I retrieve a query set, I need to add (i mean do the sum) of all the values in a column. Is there a built in django-way to do it, instead to write python code myself? In the db_api I saw order_by but I cant see something related to SUM. I know there is .extra method