0

I was wondering can you perform the following query in Django using models and queryset?

SELECT count(*), DATE_FORMAT(FROM_UNIXTIME(created_at/1000), '%Y-%m-%d') FROM users
GROUP BY YEAR(FROM_UNIXTIME(created_at/1000)), MONTH(FROM_UNIXTIME(created_at/1000)), 
DAY(FROM_UNIXTIME(created_at/1000))
ORDER BY created_at ASC;

1 Answer 1

1

Not really no.. see https://docs.djangoproject.com/en/1.6/ref/models/querysets/#field-lookups - would just use a raw SQL query

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.