Keep Every Reading While Looking at Its Neighbours

Partition and order individual records for row numbers, ranks and previous-reading comparisons without collapsing them into groups.

14 sections · 4 questions · 1 coding challenge

1 / 14

Analytical Queries Needed to Keep Their Detail

BOTIE

Ordinary aggregation answers questions about groups by producing fewer rows. Analytical reports often need a group calculation beside the original rows instead. Window functions provide that arrangement. SQLite added window-function support in September 2018.

For the technician, this means a reading can retain its timestamp and identity while receiving a position within its pump’s history. That position is meaningful only after we define the partition and its ordering.

Sources for this history