Redgate Simple Talk company blog
Don't use DISTINCT as a "join-fixer"
Using DISTINCT to fix duplicate rows from a SQL join is a common antipattern. It generates all the duplicates first, then sorts them away - hurting performance. Learn how to rewrite these queries using EXISTS for cleaner, faster SQL Server results.
- Points
- 243
- HN comments
- 170
- Submissions
- 1
- Cited by
- 0 commenters
Databases & DataSoftware Engineering2023
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| Oct 20, 2023 | Don't use DISTINCT as a "join-fixer" by todsacerdoti | 243 | 170 |