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

SubmittedTitle on HNPointsComments
Oct 20, 2023Don't use DISTINCT as a "join-fixer" by todsacerdoti243170

Related posts from the same era