# sqlalchemy.exc.MultipleResultsFound: Multiple rows were found when exactly one was required

- **ID:** `python/sqlalchemy-query-multiple-rows`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Using .one() on a query that returns more than one row.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.4.x | active | — | — |
| 2.0.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Use .scalar_one() if you expect exactly one row, or .one_or_none() if zero is acceptable.
   ```
2. **** (95% success)
   ```
   Add filters to narrow down the result: query.filter(User.id == some_id).one()
   ```

## Dead Ends

- **** — Silently ignores extra rows, possibly hiding data issues. (60% fail)
- **** — Doesn't solve the root cause; may still return the wrong row. (70% fail)
