Use this Neat Window Function Trick to Calculate Time Differences in a Time Series

Whenever you feel that itch... Can't I calculate this with SQL? The answer is: Yes you can! And you should! Let's see how... Calculating time differences between rows Let's consider the following database containing timestamps (e.g. in a log database). We're using PostgreSQL syntax for this: CREATE TABLE timestamps ( ts timestamp ); INSERT INTO … Continue reading Use this Neat Window Function Trick to Calculate Time Differences in a Time Series

Don’t Miss out on Awesome SQL Power with FIRST_VALUE(), LAST_VALUE(), LEAD(), and LAG()

If you're using a commercial database or PostgreSQL / Firebird / CUBRID, you will be able to take advantage of the full power of window functions. We've blogged about window functions' awesomeness a couple of times, in particular about ROW_NUMBER(), RANK(), DENSE_RANK(). Today, we're going to look into some awesome window functions that produce values … Continue reading Don’t Miss out on Awesome SQL Power with FIRST_VALUE(), LAST_VALUE(), LEAD(), and LAG()

jOOQ Newsletter: April 16, 2014 – Monthly, Yearly, Perpetual licenses now available

Subscribe to this newsletter here Tweet of the Day Our customers, users, and followers are sharing their love for jOOQ to the world. Here are: Mahmud who cannot wait to make more magic with jOOQ. https://twitter.com/bigthingist/status/455985890125287424 Peter Kopfler who, after hearing about jOOQ and SQL in Vienna is thrilled to take a deep dive into the … Continue reading jOOQ Newsletter: April 16, 2014 – Monthly, Yearly, Perpetual licenses now available