7. Combining Window Functions and CTEs
Daniel Bartholomew1
(1)Raleigh, North Carolina, USA
Window Functions and CTEs are great in isolation, but they can also be very useful together. This chapter will walk through some examples that demonstrate how Window Functions and CTEs can be used together. We’ll start with a simple averaging of rainfall data, then move on to how to use CTEs and Window Functions together to fix a common schema issue. Lastly, we’ll use them to do some deeper analysis on our rainfall data to find gaps and islands in our data set.
Before We Begin
The table used for the examples ...