How SQL DISTINCT and ORDER BY Are Related
blog.jooq.org