Hi, i've just upgrade my django install from 1.1 alpha to 1.1 beta.

i have a simple query.

data = mymodel.objects.extra(select={'month':'month(date)',

'test':'SUM(IF(ok,0,ok)})
data.query.group_by = [''month]

with the 1.1 alpha version the generated sql was:

 select (month(date)) AS `month`,
            (SUM(IF(ok,0,ok)) AS `test` 
 from ... 
 GROUP BY month

since the 1.1 beta the generated sql is:

select (month(date)) AS `month`,
            (SUM(IF(ok,0,ok)) AS `test` 
from ... 
GROUP BY month,month(date),(SUM(IF(ok,0,ok))

and i get a sql error: invalid use of group function.

Why all the extra fields are added in the group by clause?

Sorry for the bad english guys

Eric Bandel 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to