Re:SQL Anti-Patterns You Should Avoid
by valiant55 on Saturday October 18, 2025 @01:58PM
(#45629203)
It depends when you see it, but I agree that DISTINCT shouldn't be used in production. If I'm writing a one off query and DISTINCT gets me over the finish line sparing me a few minutes then that's fine.
[ Parent
| on HN ]
Which categories did the user post in? Which projects did the user interact with in the last week? That's all normal DISTINCT usage.
Re:SQL Anti-Patterns You Should Avoid
by ndsipa_pomu on Sunday October 19, 2025 @05:45AM
(#45633102)
There's nothing wrong with using DISTINCT correctly and it does belong in production. The author is complaining about developers that just put in DISTINCT as a matter of course rather than using it appropriately.