# django.core.exceptions.FieldError: Cannot compute Sum('price'): 'price' is an aggregate

- **ID:** `python/django-query-annotation-error`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

对已聚合的字段再次进行聚合操作

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   qs.values('category').annotate(total=Sum('price'))
   ```
2. **** (85% success)
   ```
   from django.db.models import Subquery; ...
   ```

## Dead Ends

- **** — values()不会重置聚合状态 (70% fail)
- **** — aggregate返回字典而非查询集，可能不适用 (60% fail)
