Eliminate duplicate rows in a result set.
Eliminates duplicate rows from the result set, forcing the database to sort or hash to find uniqueness. Often a symptom of missing JOIN conditions or imprecise filtering. Consider whether deduplication belongs in the query or the application layer.
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | ✓ Supported | all | DISTINCT ON not supported |
| PostgreSQL | ✓ Supported | all | Supports DISTINCT ON |
| SQL Server | ✓ Supported | all | Standard only |
| Oracle | ✓ Supported | all | Standard only |
| SQLite | ✓ Supported | all | Standard only |
Remove duplicate rows.
DISTINCT ON not supported
Supports DISTINCT ON
Standard only
Standard only
Standard only