examerioLogin
← Fullstack with Vue.jsQuestion 49 of 62

What's the difference between annotate() vs values().annotate() in Django ORM?

📘 Explanation

annotate() alone adds a computed value per object without grouping, while values().annotate() groups rows by the specified fields and computes aggregates per group via SQL GROUP BY. The wrong answers misstate this relationship, claiming restrictions on aggregation functions or reversing which one performs grouping and which doesn't.

Related questions

← PreviousNo login needed