# sqlalchemy.exc.InvalidRequestError: Could not find a FROM clause to join from. Tried joining to <User>, but got an error: Can't find any foreign key relationships between 'Address' and 'User'.

- **ID:** `python/sqlalchemy-orm-query-join-error`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Missing or incorrect foreign key definition between tables for join.

## Version Compatibility

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

## Workarounds

1. **Define foreign key in child table.** (95% success)
   ```
   class Address(Base):
    __tablename__ = 'addresses'
    id = Column(Integer, primary_key=True)
    user_id = Column(ForeignKey('users.id'))
   ```
2. **Specify join condition explicitly in query.** (90% success)
   ```
   session.query(User).join(Address, User.id == Address.user_id).all()
   ```

## Dead Ends

- **Adding a relationship without foreign key column.** — Relationship requires underlying foreign key constraint. (90% fail)
- **Using manual join with wrong column names.** — Typo or mismatch in column names. (70% fail)
