SQL DISTINCT is not a function

A very common misconception I often encounter with SQL users is the idea that DISTINCT is something like a function, and that it can take parenthesised arguments. Just recently, I've seen this Stack Overflow question where the OP was looking for a way to express this in jOOQ: SELECT DISTINCT (emp.id), emp.fname, emp.name FROM employee … Continue reading SQL DISTINCT is not a function