© Daniel Bartholomew 2017
Daniel BartholomewMariaDB and MySQL Common Table Expressions and Window Functions Revealedhttps://doi.org/10.1007/978-1-4842-3120-3_7

7. Combining Window Functions and CTEs

Daniel Bartholomew
(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 ...

Get MariaDB and MySQL Common Table Expressions and Window Functions Revealed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.