Subsequences, Regions, Runs, Gaps, and Islands
We have already talked about the GROUP BY clause in queries. The groups in a GROUP BY do not depend on any orderings. But you will often want to make other groupings that depend on an ordering of some kind. Examples of this sort of data would be ticket numbers, time series data taken at fixed intervals, and the like, which can have missing data or subsequences that are of interest. These things are easier to explain with examples. Consider a skeleton table with a sequential key and seven rows.
A subsequence in the list_val ...
Get Joe Celko's SQL for Smarties, 4th Edition 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.