Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT "profiles_follow"."follow_to_id", CASE WHEN "profiles_follow"."follow_from_id" = 1 THEN COUNT("profiles_follow"."follow_to_id") ELSE NULL END AS "cnt" FROM "profiles_follow" GROUP BY "profiles_follow"."follow_to_id", "profiles_follow"."follow_from_id" ORDER BY "cnt" DESC LIMIT 100
- Есть такой запрос, нужно убрать строчку ..."profiles_follow"."follow_from_id"...(перед ORDER BY)
- result = (Follow.objects
- .values("follow_to", "follow_from")
- .annotate(cnt=Count("follow_to"))
- .order_by("-cnt")
- .filter(follow_to_id__in=[2, 3])
- [:100]
- )
- При вот таком запросе, может кто знает как это решается?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement