~/devreads

#dense rank

4 posts

20 Jan 2023

lukaseder 1 min read

One of MySQL 8’s biggest improvements is the support of window functions. As I always said in conferences, there’s SQL before window functions and SQL after window functions. Once you start using them, you’ll use them everywhere. Some of you poor souls are unfortunate enough to be stuck on MySQL 5.7, either of your own … Continue reading Emulating Window…

sqldense rankemulationslocal variablesmysql 5.7

26 Oct 2015

lukaseder 1 min read

I’ve stumbled upon this very interesting question on Stack Overflow, recently. Its title is: [How to] compare a number with sum of subset of numbers In this article, we’ll compare the user’s imperative approach to the extremely elegant (Oracle) SQL approach. We’ll be making use of any combination of these awesome SQL features: Window functions … Continue reading How to…

sqlcommon table expressionscross applydense rankfirst

12 Aug 2014

lukaseder 1 min read

One of the best features in SQL are window functions. Dimitri Fontaine put it bluntly: There was SQL before window functions and SQL after window functions If you’re lucky enough to be using any of these databases, then you can use window functions yourself: CUBRID DB2 Firebird H2 Informix MariaDB MySQL Oracle PostgreSQL SQLite SQL … Continue reading The Difference…

sqldense rankrankranking functionsrow number

9 Jun 2014