Re:SQL Anti-Patterns You Should Avoid
by dotancohen on Saturday October 18, 2025 @12:48PM
(#45628652)
Without DISTINCT ON (which I've never used) you can use a window function via the OVER clause with PARTITION BY. I'm pretty sure that's standard SQL.
There are few other legitimate use cases of the regular `DISTINCT` that I have seen, other than the typical one-off `SELECT DISTINCT(foo) FROM bar`.