A very common type of SQL query is the TOP-N query, where we need the "TOP N" records ordered by some value, possibly per category. In this blog post, we're going to look into a variety of different aspects to this problem, as well as how to solve them with standard and non-standard SQL. These … Continue reading How to Write Efficient TOP N Queries in SQL
Tag: ranking
jOOQ users’ most frequently used databases
I have recently started an enquiry about which databases jOOQ users are most frequently using. The poll is here: https://blog.jooq.org/which-database-are-you-using-jooq-with/ Of course, such a poll is best analysed using jOOQ's OLAP features. When dumped into a POLL table in our database, we can query the database for the ranking as such: System.out.println( create.select( denseRank().over().orderBy(POLL.VOTES.desc()), POLL.VOTES … Continue reading jOOQ users’ most frequently used databases