Get the App
SLTechnology News&Howtos  ›  Database  › 

Example Analysis of sliding aggregation in mysql

Shulou Source: shulou.com Published: 2022-05-31 19:51:34 11月15日 Update

This article mainly shows you the "sample analysis of sliding aggregation in mysql", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let the editor lead you to study and study the "sample analysis of sliding aggregation in mysql".

Sliding aggregation is the operation of aggregating data within the range of sliding windows sequentially. Unlike cumulative aggregations, sliding aggregations do not count the data from the starting position to the current location.

Here, we take the statistics of the monthly orders of employees in the last three months as an example to introduce sliding aggregation.

The main difference between sliding aggregation and cumulative aggregation solutions is the conditions under which they are connected. The sliding polymerization condition is no longer b.ordermonth DATE_ADD (a.ordermonth, INTERVAL-3 MONTH) AND b.ordermonth DATE_ADD (a.ordermonth, INTERVAL-3 MONTH) AND b.ordermonth = DATE_FORMAT (a.ordermonth,'% Ymuri 01-01') AND b.ordermonth

Tags: Scenarios results solutions examples analysis differences three lower limits locations content conditions articles statistics runs data months problems learning help two Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux OPPO Reno Shulou Information Microsoft Docker