Recent Articles

SQL,

Introduction to Window Functions on Redshift

Benefits of Window Functions Window functions on Redshift provide new scope for traditional aggregate functions and make complex aggregations faster to perform and simpler to write. Window functions also allow…
Uli Bethke July 11, 2017
SQL,

Tricks with SQL: Beware of the Predicate in the Outer Join

Today we will have a look what happens when we place a filter condition into an outer join. We will also have a look at how this compares to placing…
Uli Bethke November 21, 2012
SQL,

Uses of the modulo operator: How Oracle mod can make your life easier.

You may ask, what the heck is modulo? Well, below is an easy to understand definition. "Modulo basically means keep taking the second number away from the first number. When…
Uli Bethke October 11, 2012
SQL,

LISTAGG with CLOB? String aggregation exceeding 4000 characters with XMLAGG.

We all know that the Oracle LISTAGG function does not support the CLOB datatype. In my opinion this is a severe limitation of LISTAGG (and BTW also of PIVOT and…
Uli Bethke April 23, 2012
SQL,

SQL quiz revisited: ROW_NUMBER, LAST_VALUE, FIRST_VALUE and the SQL knights value problem.

Thank you all for your entries to the recent quiz. The guys from Packt should be shortly sending out the e-books to the winners.Today I will walk you through some…
Uli Bethke November 15, 2009
SQL,

Date dimension script with Oracle SQL

The script below will create a date dimension in just one SQL statement. We don't use performance-killer nonsense such as cursors, functions etc. We just pick a start date and…
Uli Bethke February 24, 2009
spinner