On Wed, Aug 12, 2009 at 1:34 AM, lfrodrigues wrote:
>
> Sorry I didn't explain my self properly.
>
> I want this query:
> SELECT (date_format(date, '%%U')) AS `d`, SUM
> (`profile_scorehistory`.`points`) AS `l` FROM `profile_scorehistory`
> GROUP BY date_format(date, '%%U') HAVING `d`= 2
>
> How
Sorry I didn't explain my self properly.
I want this query:
SELECT (date_format(date, '%%U')) AS `d`, SUM
(`profile_scorehistory`.`points`) AS `l` FROM `profile_scorehistory`
GROUP BY date_format(date, '%%U') HAVING `d`= 2
How can I make it with ORM?
The other one was the only similar query I
On Wed, Aug 12, 2009 at 5:50 AM, lfrodrigues wrote:
>
> Hi,
>
> I'm having some problems with "having":
>
> I want to group by date and restrict to a given week, in my tests I
> can do this:
> select_data = {"d": """date_format(date, '%%U')"""}
> ScoreHistory.objects.extra(select=select_data).valu
3 matches
Mail list logo