# ERROR: missing FROM-clause entry for table "x"

**Code:** `missing FROM-clause` · **Category:** PostgreSQL · **Seen on:** PostgreSQL

The query references a table/alias that isn’t in the FROM clause (or uses the wrong alias).

## Meaning

After aliasing (users u) you must use u, not users. Also caused by referencing a joined table that wasn’t joined.

## Common causes

- Using the table name after aliasing it
- Referencing a table not joined
- Typos in aliases

## Quick fix

1. Use the alias consistently
2. Add the missing JOIN

## Detailed fix by platform

### PostgreSQL

1. `SELECT u.email FROM users u WHERE u.active;`

## How to diagnose

1. **Alias** — Which name is unknown?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/postgresql/missing-from-clause-entry)
